fix(unit): read the trigger from the event payload #91

Merged
cjournois merged 1 commit from fix/expanded-event-name into main 2026-11-03 15:34:46 +00:00
Collaborator

On 7.0.0, project/telos#180 PR CI skipped the Image job on every image unit, so a PR never builds its image. The cause is in Forgejo 17.0.1: inside a reusable workflow it expands into jobs, the runner sets github.event_name to workflow_call. The server checks job conditions with the real trigger (pull_request) and the runner checks them again with workflow_call, so the job reaches the runner and is then marked skipped (services/actions/context.go:90-95, runner act/runner/run_context.go:1416-1430). The event payload, ref and sha still belong to the original run.

  • gate.sh (the plan job) reads the trigger from the payload: pull_request, schedule, workflow_dispatch or push. When there is no payload it falls back to GITHUB_EVENT_NAME. It outputs event.
  • The image job's condition and PUSH, and the rolling base-image tag, use needs.plan.outputs.event instead of github.event_name.
  • The publish gate's workflow_dispatch / push [publish] / pull_request [publish] rules depended on the same name, and were silently off in expanded callers. They work again.

Verified: just lint test passes (492 bats; 5 new cases cover each payload shape, including GITHUB_EVENT_NAME=workflow_call), actionlint clean. Not run on a live consumer yet: after release, telos#180 repins and its PR CI should show Image running for each image unit.

Session: 3acdb5a2-9a36-4c5c-9d3c-2e7c6ac1b8e3

On 7.0.0, project/telos#180 PR CI skipped the `Image` job on every image unit, so a PR never builds its image. The cause is in Forgejo 17.0.1: inside a reusable workflow it expands into jobs, the runner sets `github.event_name` to `workflow_call`. The server checks job conditions with the real trigger (`pull_request`) and the runner checks them again with `workflow_call`, so the job reaches the runner and is then marked skipped (`services/actions/context.go:90-95`, runner `act/runner/run_context.go:1416-1430`). The event payload, ref and sha still belong to the original run. - `gate.sh` (the plan job) reads the trigger from the payload: `pull_request`, `schedule`, `workflow_dispatch` or `push`. When there is no payload it falls back to `GITHUB_EVENT_NAME`. It outputs `event`. - The image job's condition and `PUSH`, and the rolling base-image tag, use `needs.plan.outputs.event` instead of `github.event_name`. - The publish gate's `workflow_dispatch` / `push [publish]` / `pull_request [publish]` rules depended on the same name, and were silently off in expanded callers. They work again. Verified: `just lint test` passes (492 bats; 5 new cases cover each payload shape, including `GITHUB_EVENT_NAME=workflow_call`), actionlint clean. Not run on a live consumer yet: after release, telos#180 repins and its PR CI should show `Image` running for each image unit. Session: 3acdb5a2-9a36-4c5c-9d3c-2e7c6ac1b8e3
fix(unit): read the trigger from the event payload
Some checks failed
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 47s
ci: reusable-pipeline / CI Pipeline (push) Has been cancelled
7a7da6546d
Inside a reusable workflow Forgejo expands into jobs, github.event_name
is workflow_call, so the PR image check never ran and the publish gate
and rolling base-image tags misread the trigger. plan derives the event
from the payload and every job uses it.

Session: 3acdb5a2-9a36-4c5c-9d3c-2e7c6ac1b8e3
cjournois deleted branch fix/expanded-event-name 2026-11-03 15:34:46 +00:00
Sign in to join this conversation.
No reviewers
No labels
needs-human
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cjournois/reusable-pipeline!91
No description provided.