auto: PR for feat/auto-label-payload-fix #13
@@ -20,9 +20,24 @@ jobs:
|
|||||||
echo "CI_TOKEN not set; skipping labeling"; exit 0; fi
|
echo "CI_TOKEN not set; skipping labeling"; exit 0; fi
|
||||||
OWNER=$(echo "$REPO" | cut -d'/' -f1)
|
OWNER=$(echo "$REPO" | cut -d'/' -f1)
|
||||||
NAME=$(echo "$REPO" | cut -d'/' -f2)
|
NAME=$(echo "$REPO" | cut -d'/' -f2)
|
||||||
echo "Labeling PR #$PR_NUMBER on $OWNER/$NAME with 'automerge'"
|
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 [ -z "${LID:-}" ]; then
|
||||||
|
echo "Failed to resolve or create label id; skipping"; exit 0; fi
|
||||||
|
echo "Labeling PR #$PR_NUMBER with id $LID"
|
||||||
curl -sS -X POST \
|
curl -sS -X POST \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: token ${CI_TOKEN}" \
|
-H "Authorization: token ${CI_TOKEN}" \
|
||||||
"${GITEA_BASE_URL}/api/v1/repos/${OWNER}/${NAME}/issues/${PR_NUMBER}/labels" \
|
"${GITEA_BASE_URL}/api/v1/repos/${OWNER}/${NAME}/issues/${PR_NUMBER}/labels" \
|
||||||
-d '["automerge"]' || true
|
-d '{"labels":['"${LID}"']}' || true
|
||||||
|
|||||||
@@ -255,3 +255,5 @@
|
|||||||
- [ci] auto-label 재트리거 ping (2025-11-14 21:56:22)
|
- [ci] auto-label 재트리거 ping (2025-11-14 21:56:22)
|
||||||
|
|
||||||
- [ci] automerge 라벨 수동부여 후 재트리거 ping (2025-11-14 22:01:41)
|
- [ci] automerge 라벨 수동부여 후 재트리거 ping (2025-11-14 22:01:41)
|
||||||
|
|
||||||
|
- [ci] full auto pipeline 재검증 ping (2025-11-14 22:09:02)
|
||||||
|
|||||||
Reference in New Issue
Block a user