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
+1
View File
@@ -28,6 +28,7 @@ jobs:
env: env:
API_BASE: ${{ github.server_url }}/api/v1 API_BASE: ${{ github.server_url }}/api/v1
REPO: ${{ github.repository }} REPO: ${{ github.repository }}
SHA: ${{ github.sha }}
# Prefer a PAT with issue write scope (secret: GITEA_TOKEN). # Prefer a PAT with issue write scope (secret: GITEA_TOKEN).
# Default GITHUB_TOKEN is usually scoped to this repo only. # Default GITHUB_TOKEN is usually scoped to this repo only.
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
+5
View File
@@ -6,6 +6,8 @@ set -u
API_BASE="${API_BASE:?API_BASE is required}" API_BASE="${API_BASE:?API_BASE is required}"
REPO="${REPO:?REPO is required}" REPO="${REPO:?REPO is required}"
TOKEN="${TOKEN:?TOKEN is required}" TOKEN="${TOKEN:?TOKEN is required}"
SHA="${SHA:-}"
BASE="${API_BASE%/api/v1}"
LABEL="ci-checks" LABEL="ci-checks"
SHOW="${SHOW:-50}" SHOW="${SHOW:-50}"
@@ -78,6 +80,9 @@ jq -r '[((.body // "") | capture("<!-- ci-check: (?<k>[^ ]+) -->").k), .number]
while IFS=$'\t' read -r key number; do while IFS=$'\t' read -r key number; do
if ! grep -qF -- "$key"$'\t' "$FINDINGS"; then 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 api PATCH "/issues/$number" '{"state": "closed"}' > /dev/null
fi fi
done < "$WORK/keys.tsv" done < "$WORK/keys.tsv"