diff --git a/.github/workflows/ScriptPython.yml b/.github/workflows/ScriptPython.yml index 9e40aa3..7ee1f58 100644 --- a/.github/workflows/ScriptPython.yml +++ b/.github/workflows/ScriptPython.yml @@ -482,6 +482,44 @@ jobs: git status --short echo "" git diff --stat + + # ============================================================ + # 17.9. Vérification et configuration de PUSH_TOKEN + # ============================================================ + - name: 17.9. Vérifier PUSH_TOKEN + if: steps.changed.outputs.shp == 'true' || steps.changed.outputs.sql == 'true' || steps.changed.outputs.manual == 'true' + shell: bash + env: + PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }} + GH_TOKEN: ${{ secrets.PUSH_TOKEN }} + run: | + set -euo pipefail + echo "========================================" + echo "VÉRIFICATION DE PUSH_TOKEN" + echo "========================================" + # 1. Vérifier que le secret existe + if [ -z "${PUSH_TOKEN}" ]; then + echo "::error::Le secret PUSH_TOKEN est absent ou vide." + exit 1 + fi + # 2. Vérifier que le jeton est valide + echo "Vérification de l'identité GitHub..." + GH_USER="$(gh api user --jq '.login')" + echo "Jeton reconnu pour le compte : ${GH_USER}" + # 3. Vérifier l'accès au dépôt et les droits du compte + echo "Vérification des droits sur le dépôt..." + PUSH_PERMISSION="$(gh api repos/Alex38Lyon/Synthese-PSM_LARRA --jq '.permissions.push // false')" + if [ "${PUSH_PERMISSION}" != "true" ]; then + echo "::error::Le compte associé à PUSH_TOKEN ne dispose pas des droits push sur le dépôt." + exit 1 + fi + echo "Le compte dispose des droits push sur le dépôt." + # 4. Remplacer les identifiants Git persistés par checkout + # par ceux de PUSH_TOKEN, sans afficher le jeton. + AUTH_HEADER="$(printf 'x-access-token:%s' "${PUSH_TOKEN}" | base64 -w 0)" + git config --local --replace-all http.https://github.com/.extraheader "AUTHORIZATION: basic ${AUTH_HEADER}" + unset AUTH_HEADER + echo "Authentification Git configurée pour PUSH_TOKEN." # ============================================================ # 18. Commit diff --git a/Synthese-PSM_LARRA-Full.thconfig b/Synthese-PSM_LARRA-Full.thconfig index 348e76a..591324f 100644 --- a/Synthese-PSM_LARRA-Full.thconfig +++ b/Synthese-PSM_LARRA-Full.thconfig @@ -225,6 +225,7 @@ layout my_layout_atlas copy drawingconfig copy fonts_2000 copy Survey_No_Scrap + copy Atlas # Définition du système de projection du plan cs UTM30 @@ -365,11 +366,8 @@ layout my_layout_atlas \synth={Alexandre Pont pour l'ARSIP} %\ECoordinates={\inputrel{Outputs/Synthese-PSM_LARRA-Cave-list.txt}} \ECoordinates={\catcode`\_=12\obeylines\inputrel{Outputs/Synthese-PSM_LARRA-Cave-list.txt}} - endcode - copy Atlas - # map-image 4 72 nw ./Logos/Logo-ARSIP-Synthese-Topographique_XL.png endlayout