From 232321f73e9479cca0c32310f94327560bc9abd9 Mon Sep 17 00:00:00 2001 From: Jaybe Date: Fri, 14 Nov 2025 21:55:39 +0900 Subject: [PATCH] =?UTF-8?q?chore(ci):=20PR=20=EC=98=A4=ED=94=88/=EB=8F=99?= =?UTF-8?q?=EA=B8=B0=ED=99=94=20=EC=8B=9C=20'automerge'=20=EB=9D=BC?= =?UTF-8?q?=EB=B2=A8=20=EC=9E=90=EB=8F=99=20=EB=B6=80=EC=97=AC=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/auto-label.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .gitea/workflows/auto-label.yml diff --git a/.gitea/workflows/auto-label.yml b/.gitea/workflows/auto-label.yml new file mode 100644 index 0000000..f2a4acd --- /dev/null +++ b/.gitea/workflows/auto-label.yml @@ -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