fix: paginate installed repos in trusted-publisher plugin#127
Merged
Conversation
The lookup of repositories installed under the npm publisher GitHub App was using a non-paginated `octokit.request`, so only the first page of results was cached. Any repo beyond that page was treated as not-installed every cron run, repeatedly re-issuing the idempotent `add` PATCH and logging "Installing npm publisher github app into <repo>" on each pass. Switch to `octokit.paginate` (matching the sibling installations lookup just above) so the full set of installed repos is captured. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jkleinsc
approved these changes
May 26, 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.
Summary
The trusted-publisher plugin caches the list of repositories installed under the npm publisher GitHub App per-org. The fetch at
src/permissions/plugins/trusted-publisher/index.ts:73was using a non-paginatedoctokit.request, so only the first ~30 results were cached. Any repo beyond that page (e.g.extract-zip, recently added in electron/.permissions#347) was repeatedly treated as not-installed, causing the cron to re-issue the idempotentaddPATCH and logInstalling npm publisher github app into <repo>on every run, plus add a noisy line to the Slack summary.Switching to
octokit.paginatematches the pattern already used immediately above for the installations lookup, and lets octokit unwrap the{ total_count, repositories }envelope into a flat array — so we can also drop the.dataindirection.Note: We should run a dry run after this is merged to make sure it's catching the new apps.
🤖 Generated with Claude Code