Merge pull request 'auto: PR for feat/auto-label-payload-fix' (#14) from feat/auto-label-payload-fix into main
CI / test (push) Successful in 56s
CI / test (push) Successful in 56s
This commit was merged in pull request #14.
This commit is contained in:
@@ -55,12 +55,29 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "${PR_NUMBER:-}" ]; then
|
if [ -n "${PR_NUMBER:-}" ]; then
|
||||||
echo "Adding 'automerge' label to PR #$PR_NUMBER"
|
echo "Resolving label id for 'automerge' in $OWNER/$NAME"
|
||||||
curl -sS -X POST \
|
curl -sS -o /tmp/labels.json -H "Authorization: token ${CI_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
"${GITEA_BASE_URL}/api/v1/repos/${OWNER}/${NAME}/labels"
|
||||||
-H "Authorization: token ${CI_TOKEN}" \
|
LID=$(awk 'BEGIN{RS=","} /"name":"automerge"/ {if (match($0,/"id":([0-9]+)/,m)) {print m[1]; exit}}' /tmp/labels.json || true)
|
||||||
"${GITEA_BASE_URL}/api/v1/repos/${OWNER}/${NAME}/issues/${PR_NUMBER}/labels" \
|
if [ -z "${LID:-}" ]; then
|
||||||
-d '["automerge"]' || true
|
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 '{"labels":['"${LID}"']}' || true
|
||||||
|
else
|
||||||
|
echo "Failed to resolve label id; skipping label add"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "PR number could not be determined after retries; skipping label add"
|
echo "PR number could not be determined; skipping label add"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -257,3 +257,5 @@
|
|||||||
- [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)
|
- [ci] full auto pipeline 재검증 ping (2025-11-14 22:09:02)
|
||||||
|
|
||||||
|
- [ci] auto-label payload fix 재검증 ping (2025-11-14 22:15:14)
|
||||||
|
|||||||
Reference in New Issue
Block a user