Skip to content

chore: fix incorrect commit hash in PR builds#11198

Merged
jpenilla merged 2 commits into
PaperMC:masterfrom
granny:chore/fix-pr-build-file-hash
Aug 6, 2024
Merged

chore: fix incorrect commit hash in PR builds#11198
jpenilla merged 2 commits into
PaperMC:masterfrom
granny:chore/fix-pr-build-file-hash

Conversation

@granny
Copy link
Copy Markdown
Contributor

@granny granny commented Jul 30, 2024

When the build workflow runs on the pull_request trigger, the commit ref ends up being the merge commit generated for the pull request instead of the actual commit in a PR. This PR fixes that by setting the checkout ref to be the most recent commit pushed in the PR.

Since this workflow also includes the push trigger, a conditional step was added to apply the ref only if it's being run under the pull_request trigger.

docs: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
references: actions/checkout#261 https://github.com/actions/checkout#Checkout-pull-request-HEAD-commit-instead-of-merge-commit linz/geostore#2246

@granny granny requested a review from a team as a code owner July 30, 2024 20:04
Copy link
Copy Markdown
Member

@jpenilla jpenilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jpenilla jpenilla merged commit 042f15f into PaperMC:master Aug 6, 2024
@granny granny deleted the chore/fix-pr-build-file-hash branch August 6, 2024 21:25
LeonTG pushed a commit to LeonTG/Paper that referenced this pull request May 17, 2026
* fix incorrect hash in PR builds

* only apply ref on pull_request triggers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants