Replies: 2 comments
-
The temporary merge commit is a commit GitHub creates when a PR trigger runs — it simulates merging the PR branch into the base branch for testing purposes. github.sha points to that temporary commit, while github.event.pull_request.head.sha always points to the actual commit from the PR branch. To avoid flaky behavior, it's better to use github.event.pull_request.head.sha if you need the real commit from the PR. |
Beta Was this translation helpful? Give feedback.
-
Thanks for posting in the GitHub Community, @tanin47! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Discussions category is solely related to conversations around the GitHub product Discussions. This question should be in the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Discussion Type
Question
Discussion Content
Using
github.sha
causes a flaky bug on our Github Actions because sometimes github.sha matches the PR's commit and sometimes it doesn't.I googled a bit more but I can't understand what a temporary merge commit is. Can someone help explain it more? What is it? What is it used for? Does it differ from
github.event.pull_request.head.sha
for every single pull request in the context of Github Actions run? (I try to understand why usinggithub.sha
sometimes works in our case).Thank you.
Beta Was this translation helpful? Give feedback.
All reactions