Trigger action on specific source branch name #26082
-
We have a branch model with feature branches, develop, staging (for testing) and master for release. Now we have an action for the Release notes, which creates a Pull Request with the actual release notes when pushing to staging or master. But the action should only run when we push a Pull Request from develop into staging and staging into master, but not when pushing from the release notes branch into staging or master, because then we always have a new created Pull Request with the release notes. Is this possible? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @benwick91, You can use on.pull_request.branches to limit the base branch. Code sample as below:
Thanks |
Beta Was this translation helpful? Give feedback.
Hi @benwick91,
You can use on.pull_request.branches to limit the base branch.
And add job level if expression to check ‘github.head_ref’, if it’s not source branch, skip the job.
Code sample as below:
Thanks