-
I have a GitHub action that does something whenever a new issue is created. Now the workflow yaml file is in dev branch. And after pushing the yaml, file the action started. I want actions to run from workflow files only in main branch. Is there any settings option, to disable workfile file run from a specific branch? Basically what I want is, workflow files which are in allowed branches, should run. I am not talking about on : triggers. I am talking about a general repo setting, that would enforce github to ignore any workflow files in branches other than allowed branches |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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.comDisabling or limiting GitHub Actions for a repository - GitHub DocsYou 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. |
Beta Was this translation helpful? Give feedback.
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.