feat: read the commits with the token of the workflow AND fix: fail when the commits cannot be retrieved AND fix: read every page of the commits of a pull request - #7
Merged
Conversation
ncc 0.36.1 resolves the TypeScript compiler from the project, and its built-in fallback is not available, so `npm run build` fails on a clean install with "Could not load TypeScript compiler".
A failure to fetch the list of commits was turned into an empty list, which is indistinguishable from a pull request whose commit messages are all valid, so a rate limited or failing request was reported as a success. The failure is now propagated and fails the action, because not being able to analyse anything is a failure of the action itself rather than a finding about the commits. SEMVER_LEVEL is exported on that path too, so that a later step reading it does not read an empty value. Close #4
The commits of a pull request were requested anonymously, and GitHub allows an unauthenticated caller 60 requests per hour counted per IP address. Runners share those addresses, so the quota is spent by unrelated jobs and the request fails with 403 (rate limit exceeded) on pull requests that have nothing wrong with them. It also cannot read the commits of a private repository at all. The request now carries a token, taken from a new input whose default is the token of the workflow, so no caller has to be changed. An empty value restores the anonymous request and warns: since the input defaults to a token, reading the commits anonymously is a decision, and most often an oversight in the configuration of the caller. Close #8
The list of commits of a pull request is paginated. The request asked for no page size, so it received the default of 30 commits and read that page alone: every commit after the thirtieth went unchecked, and a pull request whose only offending commit was past the boundary was reported as clean. Nothing said so, because the log ends where the reading ended. The request now asks for 100 commits at a time and follows the Link header until there is no next page, so the whole branch is read whatever its length. Following the header needs nothing but the request that reads the first page, so this works with or without a token. The number of commits that were read is logged, so that a pull request checked only in part is visible in the log rather than only in what is missing. Close #5
The bundle is rebuilt from the current sources.
javier-godoy
force-pushed
the
fix/read-all-commits
branch
from
September 10, 2026 18:10
77e861f to
306e4a0
Compare
javier-godoy
marked this pull request as draft
September 10, 2026 18:13
javier-godoy
marked this pull request as ready for review
September 11, 2026 01:33
scardanzan
approved these changes
Sep 11, 2026
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.
Three defects in how the commits of a pull request are read, all of which fail open or fail
intermittently, extracted from #3 so that they can be merged on their own.
Changes
fix: fail when the commits cannot be retrievedfeat: read the commits with the token of the workflow${{ github.token }}, so no caller changes; an empty value keeps the anonymous request and warns. Close #8fix: read every page of the commits of a pull requestLinkheader. Close #5build: add typescript devDependency required by nccnpm run buildfails on a clean install without it, because ncc 0.36.1 resolves the TypeScript compiler from the project.build: rebuild the dist bundleVerification
npm testpasses (3/3).javier-godoy/test-repo#23 checks this branch directly, since the reusable workflow in
FlowingCode/GithubActionspoints at another branch of the action. It has 107 commits with aninvalid message at chronological position 104, and the run reports:
Position 104 is out of reach both of the default 30-commit page and of a single page of 100, so
only following the pages finds it. Before this branch that pull request was green.
The rest was exercised against the bundle directly:
of 5000 with the token and 60 without, and the anonymous read warns;
🚫 The commit messages could not be checked: …and setsSEMVER_LEVEL=0rather thanleaving it unwritten.
Relationship to #3
#3 carries these same three fixes in a branch that also adds the
resultsoutput and thereporting inputs, and it fixes #5 differently: through the API client's own
paginate, whichis available there because the token is. This branch follows the
Linkheader instead, whichneeds nothing but the request that reads the first page.
So whichever merges first, the other needs reconciling: if this one goes in, #3 should be
rebased onto master, where the shared commits drop out as already applied and its own
pagination commit becomes redundant.
🤖 Generated with Claude Code