mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #2709] act detects wrong event for workflow #1226
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1226
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @chibidev on GitHub (Mar 24, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2709
Bug report info
Command used with act
Describe issue
When not specifying the triggering event and relying on
actto detect, even though the job is specified via-j,actmay end up choosing the wrong event for the workflow (e.g. when one workflow usesworkflow_dispatchand the other usesworkflow_call). Unfortunately, having the wrong event also prevents correctly substituting input variables.As far as I can tell this stems from the planner not taking the specified workflow into consideration when collecting relevant event names.
I'd be happy to send a PR, but first I wanted to ask whether this is intentional or not.
Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
Second workflow file:
@Andne commented on GitHub (Apr 4, 2025):
I ran into this myself recently, it was working on one computer but not another. Finally found there is an interaction with the -W flag. One computer happened to have some cruft from earlier exploration on it so I had a conflicting job name and had to specify -W in order for that job name to resolve. When going to the other computer I left -W off and couldn't get my input arguments to make sense. Once I added the -W flag back in, the inputs were picked up correctly.
So, sounds like a bug probably, but as a workaround -W seems to keep it happier?
@chibidev commented on GitHub (Apr 5, 2025):
Obviously, if the set of workflows is constrained properly, this issue might not occur. So yes, specifying a workflow with
-Wis a possible workaround, as well as specifying the event name, re-arranging workflows into other directories, etc./#1850