From ebcd9490a72bd3f1803756201c4c5a7b1487d5c6 Mon Sep 17 00:00:00 2001 From: Antoine Guyon Date: Mon, 27 Mar 2023 13:58:25 +0200 Subject: [PATCH] Update testing.yml --- .github/workflows/testing.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 6a4dbce..3f8270a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,10 +14,19 @@ jobs: 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}" + export PROGRAM_VERSION=$(cat current_version.txt) # 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 + + - name: Mettre à jour la variable secrète + run: | + echo ${{ secrets.PERSONAL_ACCESS_TOKEN }} > access_token.txt + curl -X PATCH -H "Authorization: Bearer $(cat access_token.txt)" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/aguyonp/docker-glpi-automated/actions/secrets/PROGRAM_VERSION -d '{"encrypted_value": "'"$(echo -n "${PROGRAM_VERSION}" | base64)"'"}' + env: + PROGRAM_VERSION: ${{ env.PROGRAM_VERSION }} + + - name: Supprimer le jeton d'accès personnel + run: rm access_token.txt