chore(ci): PR 오픈/동기화 시 'automerge' 라벨 자동 부여 워크플로 추가
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
name: Auto Label PR
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
add-automerge-label:
|
||||||
|
runs-on: [macos, host]
|
||||||
|
steps:
|
||||||
|
- name: Add 'automerge' label to PR
|
||||||
|
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 labeling"; exit 0; fi
|
||||||
|
OWNER=$(echo "$REPO" | cut -d'/' -f1)
|
||||||
|
NAME=$(echo "$REPO" | cut -d'/' -f2)
|
||||||
|
echo "Labeling PR #$PR_NUMBER on $OWNER/$NAME with 'automerge'"
|
||||||
|
curl -sS -X POST \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Authorization: token ${CI_TOKEN}" \
|
||||||
|
"${GITEA_BASE_URL}/api/v1/repos/${OWNER}/${NAME}/issues/${PR_NUMBER}/labels" \
|
||||||
|
-d '["automerge"]' || true
|
||||||
Reference in New Issue
Block a user