Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: any way to access current branch latest commit? #1944

Open
kshpytsya opened this issue Oct 14, 2024 · 1 comment
Open

Question: any way to access current branch latest commit? #1944

kshpytsya opened this issue Oct 14, 2024 · 1 comment

Comments

@kshpytsya
Copy link

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
Copy link
Author

Related: #520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant