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

Base files on source branch in PR workflows #190

Merged
merged 4 commits into from
Sep 24, 2024

Conversation

chrisfenner
Copy link
Member

@chrisfenner chrisfenner commented Sep 24, 2024

This change undoes some earlier work to try to check out the source branch in some way. This breaks on e.g., private forks.

Instead, we "live with" the fact that in the context of a PR, HEAD is a merge commit. In this context, the source branch is HEAD^2 (parent 2) and we can just grab that commit hash and proceed.

@chrisfenner chrisfenner changed the title Detect merge commits (as in PRs) and switch to first parent if so Base files on source branch in PR workflows Sep 24, 2024
@chrisfenner chrisfenner marked this pull request as ready for review September 24, 2024 15:51
@chrisfenner chrisfenner merged commit 893fc8c into main Sep 24, 2024
2 checks passed
@chrisfenner chrisfenner deleted the deal-with-merge-commits branch September 24, 2024 15:52
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

Successfully merging this pull request may close these issues.

1 participant