What is the difference between these two ways to get the triggering commit? #25318
-
I need to run a workflow when a Pull Request closes, and it depends on the SHA of the most recent commit before the pull request was closed. However, when looking into ways to do that, I’ve found that These are my results from running these two commands in my action:
As you can see, what I get from |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The GITHUB_SHA of pull_request event is the Last merge commit on the Pull request head points to the source branch of the pull request. |
Beta Was this translation helpful? Give feedback.
The GITHUB_SHA of pull_request event is the Last merge commit on the
GITHUB_REF
branch . TheGITHUB_REF
is PR merge branchrefs/pull/:prNumber/merge
.Pull request head points to the source branch of the pull request.
github.event.pull_request.head.sha
is the right way to get SHA of the most recent commit before the pull request was closed.