[CI] Improve fetching of changed files #89980
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PRs always use a merge into the repo on checkout, so checking for
HEAD^1
will show all the changes regardless of the number of commits in a PR, as it represents the target commit of the mergeYou can see the improved results by comparing these two builds:
It appears the CI will still catch file formatting without the files (I think it runs on all files if none are specified) but this ensures the files are properly listed, and it seems to fail on some files in the existing version when it fails to fetch files (my bad):
The reason it partially worked (which I failed to notice because some CI checks run regardless and I didn't check other cases like header guards) was that for single commit PRs it did the correct thing, checking the merge commit against its first parent, which was correct, but with multiple commit it instead broke, unsure exactly what broke with it though, but this new change ensures it always picks the first parent of the merge and that will include all the changes and have them properly aligned with the merged state
Follow up to: