Skip to content

How to use workflow files only from a specific branch only? #25465

Answered by Simran-B
aahnik asked this question in Actions
Discussion options

You must be logged in to vote

You can restrict what actions are allowed in workflows, but there is no repository setting to restrict on what branches workflows are allowed to run:

docs.github.com

Disabling or limiting GitHub Actions for a repository - GitHub Docs

You could enable Require status checks to pass before merging and only let actions succeed if the branch is on an allow list, but that will have to be coded into the workflow itself.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants