Questions about PR workflows and actions/checkout@v2 #25961
-
Hi, I have 2 questions about GitHub Actions:
Any pull request to master branch will checkout the branch that triggered the workflow and run the rest of the workflow (tests) on that branch.
Will it checkout and run tests on the branch that triggered the PR as well? If so, is there any reason/adventage to being more specific and adding
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
Beta Was this translation helpful? Give feedback.
-
yanjingzhu:
Oh, so it creates what would be the final outcome of the PR after approval and runs the tests (or whatever else is specified in the workflow) against that? Fantastic, thank you for the clarification. |
Beta Was this translation helpful? Give feedback.
-
Yeah, using the default ref matches the normal scenario to build PR merged code. |
Beta Was this translation helpful? Give feedback.
-
You can prevent other branches to merge into Master by setting
|
Beta Was this translation helpful? Give feedback.
github.event.pull_request.head.sha
points to the pushed commit of the pull request, it is on the PR source branch.