🐛 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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user