chore(ci): 자동 PR/그린시 자동 머지 구성(CI_TOKEN 사용)
Auto PR / open-pr (push) Successful in 12s
CI / test (pull_request) Successful in 1m5s

This commit is contained in:
2025-11-14 21:22:00 +09:00
parent 1d441b17d7
commit 86a2c1049a
2 changed files with 59 additions and 0 deletions
+21
View File
@@ -42,3 +42,24 @@ jobs:
path: playwright-report
if-no-files-found: ignore
retention-days: 3
- name: Auto-merge PR on green
if: ${{ github.event_name == 'pull_request' }}
env:
CI_TOKEN: ${{ secrets.CI_TOKEN }}
GITEA_BASE_URL: https://gitea.jaybe.dev
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
if [ -z "${CI_TOKEN:-}" ]; then
echo "CI_TOKEN not set; skipping auto-merge"; exit 0; fi
OWNER=$(echo "$REPO" | cut -d'/' -f1)
NAME=$(echo "$REPO" | cut -d'/' -f2)
echo "Merging PR #$PR_NUMBER for $OWNER/$NAME"
RESP=$(curl -sS -X POST \
-H "Content-Type: application/json" \
-H "Authorization: token ${CI_TOKEN}" \
"${GITEA_BASE_URL}/api/v1/repos/${OWNER}/${NAME}/pulls/${PR_NUMBER}/merge" \
-d '{"Do":"merge","MergeMessage":"auto-merge: CI green"}' || true)
echo "API response: $RESP"