Skip to main content
The 2024 Developer Survey results are live! See the results

Disabling GitHub actions on specific branches

Created
Active
Viewed 94 times
1 replies
1

How do I can get GitHub actions disabled for branches, which is unprotected?

I want developers modifying the workflow and trying to run the actions against a custom branch. At the same time, I don't want them to be blocked for creating branches or restricting the user more with branch PR strategies or any such sort of things.

  • 2.7k
  • 6
  • 32
  • 54

1 reply

Sorted by:
78632609
1

You can ignore branches by adding prefix of branch name or specific branch name using on.pull_request|pull_request_target.branches|branches-ignore .

But I believe you can just specify list of branches for workflow to run and by default it will be disabled for other branches.