-
Hi there, Does anyone know if there’s a way to get the commit hash for the current head of the master branch on an action that runs on a pull_request? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@beldar , You can use the property " github.event.pull_request.head.sha" from the github context to fetch the commit hash for the PR’s head. You can print the github context information to the logs to fetch more detailed information about the PR.
|
Beta Was this translation helpful? Give feedback.
-
That’s great! Exactly what I needed. Thanks!! |
Beta Was this translation helpful? Give feedback.
@beldar ,
You can use the property " github.event.pull_request.head.sha" from the github context to fetch the commit hash for the PR’s head.
Similarly, you also can use " github.event.pull_request.base.sha" to fetch the commit hash for the PR’s base (master in your case).
You can print the github context information to the logs to fetch more detailed information about the PR.