Github Actions only triggers on default branch. #277
-
Is there a way Github actions can trigger an event on a specific action (example push/pull request) to a non-default branch? |
Beta Was this translation helpful? Give feedback.
Answered by
manasesjesus
Oct 22, 2021
Replies: 3 comments 7 replies
-
We can switch to another branch with the Here is an example workflow:
- uses: actions/checkout@v2
with:
# The branch, tag or SHA to checkout. When checking out the repository that
# triggered a workflow, this defaults to the reference or SHA for that event.
# Otherwise, defaults to `master`.
ref: 'develop'
- uses: actions/your-action@v1 |
Beta Was this translation helpful? Give feedback.
7 replies
-
What would be a walkaround for this then? |
Beta Was this translation helpful? Give feedback.
0 replies
-
You need to specify the events and branches that will trigger your action: on:
# Set your workflow to run on push events to the develop and all feature branches
push:
branches:
- develop
- feature/*
# Set your workflow to run on pull request events that target the main branch
pull_request:
branches:
- main |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
MerNat
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to specify the events and branches that will trigger your action: