From 0f01a6cf986a535e8ebe3beeb40ec96dabb97e29 Mon Sep 17 00:00:00 2001 From: Antoine Guyon Date: Mon, 27 Mar 2023 10:47:01 +0200 Subject: [PATCH] Create testing.yml --- .github/workflows/testing.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..c8d0e9c --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,22 @@ +name: Mise à jour automatique du programme +on: + schedule: + - cron: '0 * * * *' # Exécute la pipeline toutes les heures +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Extraire la valeur HTML spécifique + run: | + wget -O - https://glpi-project.org/fr/telecharger-glpi/ | grep "

GLPI VERSION" | sed -n 's/.*GLPI VERSION \([0-9.]*\).*/\1/p' > current_version.txt + - name: Comparer les versions + run: | + if ! diff current_version.txt <(echo ${{ secrets.PROGRAM_VERSION }}); then + echo "Une nouvelle version du programme est disponible." + export NEW_VERSION=$(cat current_version.txt) + echo "::set-secrets name=PROGRAM_VERSION::${NEW_VERSION}" + # Continuer le processus de mise à jour ici + else + echo "Le programme est à jour." + exit 1 # Arrête la pipeline avec un code d'erreur + fi