fix: make workflow_dispatch actually run code jobs #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/detect-changes-workflow-dispatch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The event dispatch in
detect-changes.ymlhas two branches, not three — anything that isn't apushfalls into thepull_requestbranch:On
workflow_dispatchthere is nogithub.event.pull_request.base.sha, so it expands to:has_codeis therefore always'false', and every code job skips. Manual re-trigger has been silently inert in all 10 consuming repos —workflow_dispatchis declared in their CI as an escape hatch and has never been able to run anything.How it surfaced
On
jaberson-planner, runs #396 and #397 were fired viaworkflow_dispatchto clear a red CI status. Both skipped every job:Two manual attempts that could never have worked.
Fix
Split the
elseinto an explicitpull_requestbranch plus a catch-all that setsCHANGED="force-run". That string fails the doc-only exclusion grep, sohas_code=true— the same escape hatch the existing|| echo "force-run"fallbacks already rely on.Verification
Ran the filter expression against 10 event shapes:
force-run(workflow_dispatch, new)truefalsedocs/foo.mdfalseREADME.mdfalseCLAUDE.mdfalse.workstream/state.jsonfalseapp/main.pytruetrue.forgejo/workflows/ci.ymltrueDockerfiletrueOnly the
workflow_dispatchcase changes.pushandpull_requestpaths are untouched.Blast radius
Consumed at
@mainby 10 repos, so this takes effect immediately on merge: haskydocs-v2, haskytech-modules-py, markspace-website, heyco, keizen-wa, keizen-full, rainbowcentre, jaberson-planner, jaberson-timecard.The change can only cause more jobs to run, never fewer — a manual dispatch that previously did nothing will now execute the full pipeline. Revert is a one-line rollback.
Note
Repos with an inline
detect-changesjob rather than this reusable workflow (smeos, tachikoma) carry the same two-branch bug independently and are not fixed here.The event dispatch had two branches, not three: anything that was not a push fell into the pull_request branch. On workflow_dispatch there is no github.event.pull_request.base.sha, so the command expanded to git diff --name-only HEAD — an empty diff. has_code was therefore always 'false' and every code job was skipped. Manual re-trigger has been silently inert in all 10 consuming repos. Found on jaberson-planner, where two workflow_dispatch runs (#396, #397) were fired to clear a red CI status. Both skipped every job and could never have worked. Non-push, non-PR events (workflow_dispatch, schedule) now set CHANGED to 'force-run', which fails the doc-only exclusion grep and yields has_code=true — the same escape hatch the existing '|| echo force-run' fallbacks already use. Verified the filter against 10 event shapes: workflow_dispatch flips false -> true; docs-only, md-only, CLAUDE.md-only, workstream-only stay false; code, mixed, workflow-file and Dockerfile changes stay true.