checkout icon indicating copy to clipboard operation
checkout copied to clipboard

Question: any way to access current branch latest commit?

Open kshpytsya opened this issue 1 year ago • 1 comments

As mentioned in #573, the checkout action does all it can to present, during repeated runs, the state of the checked out repo the way it was during the first run. The problem I am trying to solve is to detect whether the commit referenced by GITHUB_SHA is still the latest in the branch being processed, to be able to skip some deployment-like activities. Is there any way to get sha of current latest commit in specific branch without resorting to extra accesses to remote repo? Something like git log -1 --pretty=format:"%H" origin/main doesn't work due to a forced update done by the checkout action.

kshpytsya avatar Oct 14 '24 19:10 kshpytsya

Related: #520

kshpytsya avatar Oct 14 '24 19:10 kshpytsya