ci(actions): accept secret 'giteatoken' as fallback for auto-merge

This commit is contained in:
Your Name
2025-09-30 20:15:29 +08:00
parent 641158a580
commit 497039451f

View File

@@ -32,12 +32,17 @@ jobs:
steps:
- name: Auto-merge PR on success
env:
# Prefer GITEA_TOKEN; fall back to giteatoken if provided
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_TOKEN_ALT: ${{ secrets.giteatoken }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
if [ -z "$GITEA_TOKEN" ] && [ -n "$GITEA_TOKEN_ALT" ]; then
GITEA_TOKEN="$GITEA_TOKEN_ALT"
fi
if [ -z "$GITEA_TOKEN" ]; then
echo "GITEA_TOKEN not set, skipping auto-merge"; exit 0;
echo "No token found in secrets (GITEA_TOKEN or giteatoken). Skipping auto-merge."; exit 0;
fi
curl -sS -H "Authorization: token $GITEA_TOKEN" -H 'Content-Type: application/json' \
-X POST "http://localhost:3000/api/v1/repos/${REPO}/pulls/${PR_NUMBER}/merge" \