Post date:
Quick question - let's say I show you a GitHub API response listing some pull requests. Among other things, the listed objects have a property called merge_commit_sha
- it's set to null
on some and it's a valid SHA string on others. What would you assume about those PRs based on that property?
If your answer is that the ones with merge_commit_sha
set to null
are not yet merged while the ones with merge_commit_sha
are merged and the merge_commit_sha
is a SHA of the merge commit - you're wrong. I assumed that too and caused a bug.
The actual answer is that:
merge_commit_sha
set to null
.merge_commit_sha
set to the SHA of their merge commit.merge_commit_sha
set to a SHA of a secret internal commit that GitHub creates behind the scenes to test the mergeability of your branch.To be fair, they say so in the documentation, but it still threw me off.