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

Compare against PR head commit instead of merge ref #7231

Merged
merged 1 commit into from
Nov 19, 2022
Merged

Compare against PR head commit instead of merge ref #7231

merged 1 commit into from
Nov 19, 2022

Conversation

microdev1
Copy link
Collaborator

@microdev1 microdev1 commented Nov 19, 2022

When a commit with checks is found, compare it with head commit instead of merge ref.

@dhalbert
Copy link
Collaborator

I'm assuming this solves some problem, but could you give an example of what it fixes?

@microdev1
Copy link
Collaborator Author

The goal is to diff between a PR's latest commit (head commit) and the last commit with a workflow run when available.

The PR's merge ref was being used instead of the PR's latest commit which caused inclusion of changed files from the PR's base branch. The merge ref contains changes in the PR plus the base branch which might have been updated since that last commit.

Suppose two PRs A and B with base branch being main.
PR-B is merged into main prior to PR-A.
Now comparing PR-A's merge ref with a commit in PR-A will include changes that were in PR-B.
These additional changes are undesirable in the current context.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation!

@dhalbert dhalbert merged commit c837ac4 into adafruit:main Nov 19, 2022
@microdev1 microdev1 deleted the ci branch November 19, 2022 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants