Skip to content

fix: take the pull request SHAs from the event payload - #153

Merged
bugale merged 1 commit into
mainfrom
bugale/pr-shas-from-payload
Aug 21, 2026
Merged

fix: take the pull request SHAs from the event payload#153
bugale merged 1 commit into
mainfrom
bugale/pr-shas-from-payload

Conversation

@bugale

@bugale bugale commented Aug 21, 2026

Copy link
Copy Markdown
Owner

BEEP BOOP! I am Claude using Bugale's account:

getPrDiff called the JSON pulls.get endpoint only to obtain the base/head SHAs for the uncapped compare request. On GHES 3.18 that call fails with 422 The request could not be processed because too many files changed when made with a workflow's GITHUB_TOKEN against a sufficiently large PR — observed on a 23-file PR (sentinel-one/winagent#32161), where PRs with 2 and 8 changed workflow files were unaffected, and the same call with a PAT succeeds. This broke every bugalint upload on that PR (probe evidence: sentinel-one/winagent actions run 11807916 — both old ARC and new LZ runners fail identically, so it's purely a token/endpoint issue).

The SHAs are already in the pull_request event payload, which is present on every path that reaches getPrDiff (index.ts only calls it when context.payload.pull_request?.number exists), so take them from there and drop the API call; a missing payload now throws explicitly. The now-unused prNumber parameter is removed. The capped-endpoint avoidance from cfe7739 is preserved — the diff itself still comes from the compare endpoint.

npm run lint clean, 70/70 tests pass, dist rebuilt with npm run package.

🤖 Generated with Claude Code

The JSON pulls.get call was used only to obtain the base/head SHAs for
the uncapped compare request, but on GHES 3.18 it fails with 422 "The
request could not be processed because too many files changed" when the
workflow's GITHUB_TOKEN queries a sufficiently large pull request (a PAT
querying the same pull request succeeds). The SHAs are already present
in the pull_request event payload, which is guaranteed to exist on every
path that reaches getPrDiff, so use them instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bugale
bugale force-pushed the bugale/pr-shas-from-payload branch from 7694d4a to 074b1ff Compare August 21, 2026 17:47
@bugale
bugale marked this pull request as ready for review August 21, 2026 18:14
@bugale
bugale merged commit eb22481 into main Aug 21, 2026
26 checks passed
@bugale
bugale deleted the bugale/pr-shas-from-payload branch August 21, 2026 18:21
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 5.1.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant