auto: PR for feat/auto-label-payload-fix #14

Merged
jaybe merged 1 commits from feat/auto-label-payload-fix into main 2025-11-14 13:17:18 +00:00
2 changed files with 26 additions and 7 deletions
Showing only changes of commit 2e69714dba - Show all commits
+20 -3
View File
@@ -55,12 +55,29 @@ jobs:
done
if [ -n "${PR_NUMBER:-}" ]; then
echo "Adding 'automerge' label to PR #$PR_NUMBER"
echo "Resolving label id for 'automerge' in $OWNER/$NAME"
curl -sS -o /tmp/labels.json -H "Authorization: token ${CI_TOKEN}" \
"${GITEA_BASE_URL}/api/v1/repos/${OWNER}/${NAME}/labels"
LID=$(awk 'BEGIN{RS=","} /"name":"automerge"/ {if (match($0,/"id":([0-9]+)/,m)) {print m[1]; exit}}' /tmp/labels.json || true)
if [ -z "${LID:-}" ]; then
echo "Label 'automerge' not found. Creating..."
curl -sS -o /tmp/create_label.json -X POST \
-H "Content-Type: application/json" \
-H "Authorization: token ${CI_TOKEN}" \
"${GITEA_BASE_URL}/api/v1/repos/${OWNER}/${NAME}/labels" \
-d '{"name":"automerge","color":"#0ea5e9"}'
LID=$(sed -n 's/.*"id":\([0-9]*\).*/\1/p' /tmp/create_label.json | head -n1 || true)
fi
if [ -n "${LID:-}" ]; then
echo "Adding 'automerge' (id=$LID) label to PR #$PR_NUMBER"
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
-d '{"labels":['"${LID}"']}' || true
else
echo "PR number could not be determined after retries; skipping label add"
echo "Failed to resolve label id; skipping label add"
fi
else
echo "PR number could not be determined; skipping label add"
fi
+2
View File
@@ -257,3 +257,5 @@
- [ci] automerge 라벨 수동부여 후 재트리거 ping (2025-11-14 22:01:41)
- [ci] full auto pipeline 재검증 ping (2025-11-14 22:09:02)
- [ci] auto-label payload fix 재검증 ping (2025-11-14 22:15:14)