🐛 fix(ci): correggi URL istanza, token e struttura YAML nei workflow condivisi

- Sostituito URL hardcoded con ${{ gitea.server_url }} (portabilità)
- Sostituito ${{ secrets.GITEA_TOKEN }} con ${{ gitea.token }} (token automatico)
- Aggiunto env SERVER_URL/REPOSITORY per evitare espressioni inline nei curl
- Fix dependency-check: rimosso BODY multi-riga (bug YAML run:|) → printf + /tmp/body.md
- Fix auto-release: changelog su /tmp/changelog.txt (evita collisione workspace)
- Fix branch-cleanup: encoding branch via variabile (sicurezza shell)
This commit is contained in:
LucaZanni
2026-03-26 07:01:34 +01:00
parent e5df154060
commit f1305498c1
3 changed files with 19 additions and 22 deletions
+6 -2
View File
@@ -10,7 +10,9 @@ jobs:
steps:
- name: Delete merged branch
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_TOKEN: ${{ gitea.token }}
SERVER_URL: ${{ gitea.server_url }}
REPOSITORY: ${{ gitea.repository }}
run: |
BRANCH="${{ gitea.event.pull_request.head.ref }}"
@@ -19,8 +21,10 @@ jobs:
exit 0
fi
ENCODED_BRANCH=$(python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1], safe=''))" "$BRANCH")
curl -s -X DELETE \
-H "Authorization: token $GITEA_TOKEN" \
"https://gitea.pzetatouch.it/api/v1/repos/${{ gitea.repository }}/branches/$(python3 -c "import urllib.parse; print(urllib.parse.quote('$BRANCH', safe=''))")"
"$SERVER_URL/api/v1/repos/$REPOSITORY/branches/$ENCODED_BRANCH"
echo "Branch eliminato: $BRANCH"