GITHUB_SHA not always correct #25341
-
Sometimes the GITHUB_SHA doesn’t seem to match the commits for the PR branch. This doesn’t happen all the time - but when it does happen it seems to be persistent for that PR no matter how many commits you push to the branch being merged. example : https://github.com/microsoft/azuredatastudio/pull/10879/checks?check_run_id=766753586 Locally I run these commands to switch to the PR branch : git fetch origin +refs/pull/10879/merge:refs/remotes/pull/10879/merge And then git log : d3cf158c11fa584702248cd2e54f84a44166f7e9 (HEAD, pull/10879/merge) Merge e17cf53bd3b48e03fc4d86edb93107f5c9e4bb94 into 233646330e08351de40267c2c26faf644ac05155 In the failed check you can see that Coveralls upload task failed with this error : ##[error]Error: Command failed: git cat-file -p dae9cdfaf4d02ebd1900c62f150297dd3b0553e2 The hash it uses is the GITHUB_SHA environment variable set for the action. But that doesn’t match the hash of the merge commit. This works fine in other cases though. Example : https://github.com/microsoft/azuredatastudio/pull/10855/checks?check_run_id=766338968 I did the same thing there - locally ran these commands : git fetch origin +refs/pull/10855/merge:refs/remotes/pull/10855/merge and got this as the merge commit e4b1ab3b1f9a231ad98eefe0b0e39401e7521499 (HEAD, pull/10855/merge) Merge f2628d1d2340fb69880279bebfe91f1c50457bb1 into a7110d89160e25cf914030dd467f3d85c0292692 which matches the GITHUB_SHA indicated in the action GITHUB_SHA=e4b1ab3b1f9a231ad98eefe0b0e39401e7521499 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @Charles-Gagnon, Could you please add below script to confirm the github sha value? I forked the repo but failed to repro on my side.
Thanks. |
Beta Was this translation helpful? Give feedback.
-
github.com/microsoft/azuredatastudio
Initial unit tests for class NotebookEditor
sha from the context :
from the checkout step :
I get the same thing if I run this command locally
(let me know if you need more - size limits mean I can’t paste the whole context) |
Beta Was this translation helpful? Give feedback.
-
After some help with the investigation it ended up being that the checkout action being used wasn’t pulling the correct version down and so there was a mismatch between what was checked out and what the GITHUB_SHA was. Updating to v2.2.0 of the checkout action should solve the issue. github.com/coverallsapp/github-actionUpload failing randomly during getOptions
Most of the time the upload task works fine, but occasionally it'll fail with the following error : [error] "2020-06-12T05:29:37.644Z" 'error from... |
Beta Was this translation helpful? Give feedback.
After some help with the investigation it ended up being that the checkout action being used wasn’t pulling the correct version down and so there was a mismatch between what was checked out and what the GITHUB_SHA was.
Updating to v2.2.0 of the checkout action should solve the issue.
github.com/coverallsapp/github-actionUpload failing randomly during getOptions