Build all the pull request created against any branch. #26990
-
So the thing is we want to verify if the PR that is merged to a target branch does not break the build. So we want to run a actions job to build all PR that are created against any branch on our repo Example 1 : master <---- BRANCH_1. we need to merge this BRANCH_1 with master and run our build steps before we can merge the PR created against it. Example2 : BRANCH_DEV <-------- BRANCH_XX We also need to merge this BRANCH_XX to BRANCH_DEV and run our build steps before we can merge the PR. My current workflow file is
But when i do this there are multiple build jobs triggered. Can someone help me understand this case and point me the right way to do this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @jeran7x , If your build jobs are triggered at the same time, please check if there are any status check required in branch protection rules on the target branch, please refer to official doc for more details.
pull_request workflow will not help to merge the code automatically, if you check the github context, you will find the affected ref is ‘/refs/pull/prnumber/merge’ which is a temporary&fake merged branch. pull_request event doesn’t accept ‘- “**”’,only accept activity types, branches/tags, paths. If you’d like to trigger PR workflow for any branch, you need to put the workflow yaml file in each source branch , code sample as below:
Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi @jeran7x , thanks for your kudos mark, is there any other query for this ticket? |
Beta Was this translation helpful? Give feedback.
Hi @jeran7x , thanks for your kudos mark, is there any other query for this ticket?