Comment the fixing commit when a check issue closes.
Checks / checks (push) Successful in 1m56s
Trigger cinny-mobile / dispatch (push) Successful in 1s

This commit is contained in:
2026-11-01 03:43:06 +11:00
parent a77f72f5d6
commit c0aa7fa8f5
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -6,6 +6,8 @@ set -u
API_BASE="${API_BASE:?API_BASE is required}"
REPO="${REPO:?REPO is required}"
TOKEN="${TOKEN:?TOKEN is required}"
SHA="${SHA:-}"
BASE="${API_BASE%/api/v1}"
LABEL="ci-checks"
SHOW="${SHOW:-50}"
@@ -78,6 +80,9 @@ jq -r '[((.body // "") | capture("<!-- ci-check: (?<k>[^ ]+) -->").k), .number]
while IFS=$'\t' read -r key number; do
if ! grep -qF -- "$key"$'\t' "$FINDINGS"; then
if [ -n "$SHA" ]; then
api POST "/issues/$number/comments" "$(jq -n --arg b "Fixed in [$(printf '%s' "$SHA" | cut -c1-7)]($BASE/commit/$SHA)." '{body: $b}')" > /dev/null
fi
api PATCH "/issues/$number" '{"state": "closed"}' > /dev/null
fi
done < "$WORK/keys.tsv"