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

Commit SHA for GitHub Actions is incorrect for Pull requests #67

Closed
vincent-psarga opened this issue Jan 31, 2022 · 1 comment
Closed

Comments

@vincent-psarga
Copy link
Contributor

Describe the bug

The commit SHA provided in a PR is not the SHA of the last commit in this PR (instead, it's a merge commit between the last commit and the base branch, usually main).

Additional context

Some extra infos and a potential solution here: https://github.community/t/github-sha-not-the-same-as-the-triggering-commit/18286/3

aslakhellesoy added a commit that referenced this issue Mar 4, 2022
* Javascript: provide correct SHA for GitHub actions (#67)

* Use new worflow event format

* Linting

* Remove checking SHA in GHA

The idea was to do an acceptance test, but running `git rev-parse HEAD` does not
show the "correct" SHA (it shows the same than the GITHUB_SHA env var)

* Also implement correct SHA for Ruby

* Linting

* Fix CamelCase in Ruby

* Only read event file for pull requests

* Java: Read revision from GITHUB_EVENT_PATH

* Rename

* Update changelog

* Reduce visibility

* Restore empty constructor

Co-authored-by: Aslak Hellesøy <1000+aslakhellesoy@users.noreply.github.com>
Co-authored-by: Aslak Hellesøy <aslak.hellesoy@gmail.com>
@aslakhellesoy
Copy link
Contributor

Fixed by #69

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

2 participants