ci: scope notify wrappers to specific source workflows (#60)
Replace `workflows: ["*"]` catch-all with explicit lists per wrapper so wrappers only trigger on relevant completions instead of running and being filtered out at the reusable level (95-100% skipped runs previously). Add job-level `if:` to short-circuit non-matching conclusions, keeping the reusable's filter as defense-in-depth. Renaming source workflows now requires updating these lists — comments warn about the coupling. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
74b68749ff
commit
4540e1eac4
3 files changed
+34
-6
No files matched your search
@@ -2,7 +2,25 @@ name: Notify CI Failures
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["*"]
|
||||
# Listen only to workflows we want failure notifications for. Replaces the
|
||||
# earlier `workflows: ["*"]` catch-all that fired on every completion and
|
||||
# was filtered out by the reusable's `if:` (95%+ skip rate).
|
||||
#
|
||||
# WARNING: these strings must match the `name:` field in each source
|
||||
# workflow's YAML. Renaming a source workflow → update this list, or
|
||||
# notifications silently break.
|
||||
workflows:
|
||||
- "Auto Update JSON Data"
|
||||
- "Generate Markdown Tables"
|
||||
- "Top Online Leaderboard"
|
||||
- "Update Reviews"
|
||||
- "Check Dead Links"
|
||||
- "Purge Unhealthy Games"
|
||||
- "Ingest New Game Links"
|
||||
- "Ingest from Issue"
|
||||
- "Bot Ingest"
|
||||
- "Force Re-fetch All (v2.1 Schema)"
|
||||
- "CodeQL"
|
||||
types: [completed]
|
||||
|
||||
# REQUIRED: declare permissions matching the reusable workflow's needs.
|
||||
@@ -13,5 +31,8 @@ permissions:
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
# Defense-in-depth: only fire on actual failures so the reusable's own
|
||||
# `if:` becomes a no-op rather than a "skipped" run.
|
||||
if: github.event.workflow_run.conclusion == 'failure'
|
||||
uses: poli0981/.github/.github/workflows/notify-ci-failure.yml@main
|
||||
secrets: inherit
|
||||
secrets: inherit
|
||||
@@ -2,7 +2,9 @@ name: Notify Deploy Status
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["*"]
|
||||
# Only the deploy workflow's name matters here. Renaming "Deploy Web
|
||||
# (GitHub Pages)" → update this list.
|
||||
workflows: ["Deploy Web (GitHub Pages)"]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
@@ -11,5 +13,6 @@ permissions:
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
if: contains(fromJSON('["success","failure"]'), github.event.workflow_run.conclusion)
|
||||
uses: poli0981/.github/.github/workflows/notify-deploy.yml@main
|
||||
secrets: inherit
|
||||
secrets: inherit
|
||||
@@ -2,7 +2,10 @@ name: Notify Release Pipeline
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["*"]
|
||||
# Release-related workflows only. Renaming any of these → update list.
|
||||
workflows:
|
||||
- "Release Desktop App"
|
||||
- "Announce Release to Discord"
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
@@ -11,5 +14,6 @@ permissions:
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
if: contains(fromJSON('["success","failure","cancelled"]'), github.event.workflow_run.conclusion)
|
||||
uses: poli0981/.github/.github/workflows/notify-release-pipeline.yml@main
|
||||
secrets: inherit
|
||||
secrets: inherit
|
||||
Reference in new issue
Block a user