ci(actions): accept secret 'giteatoken' as fallback for auto-merge
This commit is contained in:
@@ -32,12 +32,17 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Auto-merge PR on success
|
- name: Auto-merge PR on success
|
||||||
env:
|
env:
|
||||||
|
# Prefer GITEA_TOKEN; fall back to giteatoken if provided
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
GITEA_TOKEN_ALT: ${{ secrets.giteatoken }}
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
run: |
|
run: |
|
||||||
|
if [ -z "$GITEA_TOKEN" ] && [ -n "$GITEA_TOKEN_ALT" ]; then
|
||||||
|
GITEA_TOKEN="$GITEA_TOKEN_ALT"
|
||||||
|
fi
|
||||||
if [ -z "$GITEA_TOKEN" ]; then
|
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
|
fi
|
||||||
curl -sS -H "Authorization: token $GITEA_TOKEN" -H 'Content-Type: application/json' \
|
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" \
|
-X POST "http://localhost:3000/api/v1/repos/${REPO}/pulls/${PR_NUMBER}/merge" \
|
||||||
|
|||||||
Reference in New Issue
Block a user