Skip to content
Discussion options

You must be logged in to vote

Hey! I ran into this exact confusion a while back. The short answer to your question is that for push events, GitHub Actions looks at the workflow file on the branch where the event actually happens. It doesn't read from main unless the push was actually to main.

Here is how that plays out for your two scenarios:

If you go with Scenario 1 (the catch-all on main), and someone pushes to release/v1, GitHub completely ignores the workflow file on main. It checks out the release/v1 branch and looks for the .github/workflows folder there.

If the file doesn't exist on release/v1, nothing runs.

If it does exist, it runs whatever is defined in the release/v1 version of that file.

Because of how th…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ringods
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage Workflow Configuration Topics about workflow files, YAML setup, job dependencies, and general workflow configuration issues
3 participants