ntfy: link run by ID, name the branch

The run page is addressed by run ID, not run number, and event_name is
always workflow_call in a called workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
thomas.gloorandClaude Opus 5.5 committed 2026-10-26 09:33:27 +01:00
1 parent 8b8063bec8
commit af9b97e111
2 files changed
+10 -9

No files matched your search

+7 -6
View File
@@ -156,20 +156,21 @@ jobs:
NTFY_URL: ${{ vars.NTFY_URL }}
NTFY_TOKEN: ${{ secrets.NTFY_TOKEN }}
SCAN: ${{ steps.scan.outcome }}
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}
EVENT: ${{ gitea.event_name }}
# The run page is addressed by run ID, not run number. event_name is
# always workflow_call here, so the message names the branch instead.
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
run: |
if [ "$SCAN" = failure ] && [ -f trivy.log ]; then
title="CVEs in $GITHUB_REPOSITORY"
title="CVEs in $GITHUB_REPOSITORY ($GITHUB_REF_NAME)"
body=$(grep -oE '(CVE|GHSA)-[0-9A-Za-z-]+' trivy.log | sort -u | tr '\n' ' ' || true)
tags=rotating_light
else
title="Build failed: $GITHUB_REPOSITORY"
body="Failed on $GITHUB_REF_NAME"
title="Build failed: $GITHUB_REPOSITORY ($GITHUB_REF_NAME)"
body=
tags=x
fi
body="${body% }"
body="${body:-See run log} ($EVENT)"
body="${body:-See run log}"
auth=()
[ -n "$NTFY_TOKEN" ] && auth=(-H "Authorization: Bearer $NTFY_TOKEN")
curl -fsS "${auth[@]}" -H "Title: $title" -H "Tags: $tags" \