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

chore: fix incorrect commit hash in PR builds #11198

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

granny
Copy link
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
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
4 checks passed
@granny granny deleted the chore/fix-pr-build-file-hash branch August 6, 2024 21:25
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