fix(ci): allow workflow_call triggers to pass through if-guard in Pi workflows #12
No reviewers
Labels
No labels
dependencies
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
alex/.profile!12
Loading…
Reference in a new issue
No description provided.
Delete branch "pi/issue11-1783865730356"
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
ifcondition inpi-assign.yml(line 22) causes the job to be skipped when triggered viaworkflow_callfrom other repos:When another repo (e.g.
alex/ansible) calls this reusable workflow viaworkflow_call, theforgejo.eventcontext represents theworkflow_callevent — not the originalissues: assignedevent. Theworkflow_callevent payload has noassigneefield, soforgejo.event.assignee.loginisnull, the condition evaluates tofalse, and the job is skipped.This is exactly what happened with ansible#67 — the issue was assigned to Pi, the wrapper workflow fired, called this reusable workflow, but the job was skipped (run 160).
Fix
Add
forgejo.event_name == 'workflow_call'as an alternative condition to bothpi-assign.ymlandpi.yml:When called via
workflow_call, the caller repo is the one that receives the original event and is responsible for filtering. The reusable workflow should run unconditionally when invoked this way.Note for caller repos
Caller repos (e.g.
ansible) should add their owniffilter on the calling job so they don't waste runs on non-Pi assignments:Fixes #11