fix(.github/workflows): detect PR-changed modules via the pulls files API - #1046
Merged
bpmct merged 3 commits intoAug 11, 2026
Merged
Conversation
matifali
reviewed
Aug 11, 2026
bpmct
enabled auto-merge (squash)
August 11, 2026 17:43
bpmct
deleted the
ben/reg-74-unrelated-module-scorecards-on-pr-commnets
branch
August 11, 2026 18:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the Module Scorecard Check commenting on modules a PR never touched, reported on #1034 where a
windows-rdpPR got a scorecard comparison forcoder/git-clone.Linear: REG-74
Root cause
The workflow detected changed modules with
git diff "${BASE_SHA}"...HEAD, whereBASE_SHAisgithub.event.pull_request.base.shaand HEAD is GitHub's test merge commit (PR head merged into current main).base.shais the base tip from when the PR was opened, so on PRs whose base has since moved, the diff includes every module merged to main after the PR branched. #1034 was opened July 29;git-clonechanged on main afterwards (#1037), so a later synchronize run scored it, and score noise made it look like a regression.Change
GET /repos/{owner}/{repo}/pulls/{n}/files(paginated) instead of git plumbing. The PR files list is the source of truth for what a PR changes, regardless of how stale the branch is.fetch-depth: 0from checkout; it existed only for the diff.grepso a PR with no module files doesn't fail the step underpipefail.Validation
Against #1034 directly: the files API returns only
windows-rdppaths, while the oldbase.shadiff on the same PR spans dozens of unrelated commits including thegit-clonechange.🤖 Generated with Coder Agents