|
|
|
|
@ -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
|
|
|
|
|
|