fix(github): preserve install health least privilege - #1275
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1275 +/- ##
=======================================
Coverage 95.03% 95.03%
=======================================
Files 177 177
Lines 19894 19894
Branches 7170 7170
=======================================
Hits 18906 18906
Misses 395 395
Partials 593 593
🚀 New features to boost your workflow:
|
This was referenced Jul 7, 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.
Motivation
pull_requests:writewhen the persistedmissingPermissionslist contains only the permission name and not the required access level, preserving least privilege.Description
enrichInstallationHealthto only upgradepull_requeststowritewhenmissingPermissionscontainspull_requestsand the storedhealth.permissions.pull_requestssatisfiesread(indicating an upgrade towriteis required); otherwise keep the baselinepull_requests: readremediation. (src/github/backfill.ts)pull_requestsis absent entirely and the remediation should requestreadrather thanwrite. (test/unit/backfill.test.ts)Testing
npx vitest run test/unit/backfill.test.ts -t "pull_requests", and the targeted tests passed.npm run test:coverage -- test/unit/backfill.test.ts, but V8 coverage remapping failed withTypeError: jsTokens is not a functionwhile generating the local coverage report.npm run test:cicould not complete in this environment due to local dependency/registry issues (pg/ioredistype resolution and a403from the registry), so the complete gate was not run here.Codex Task