fix: improve error messages for branch-protection and pip-install checks - #5174
Open
rickgcv wants to merge 1 commit into
Open
fix: improve error messages for branch-protection and pip-install checks#5174rickgcv wants to merge 1 commit into
rickgcv wants to merge 1 commit into
Conversation
- Make isPermissionsError case-insensitive to handle API capitalisation differences when GITHUB_TOKEN lacks admin permission on branch protection - Rewrite classicBranchErrMsg to name the missing permission and link to fix - Add pip-specific message in generateTextUnpinned pointing to --require-hashes Fixes ossf#2946 Fixes ossf#2444 Signed-off-by: Ricardo Garcia Cavero <57412427+rickgcv@users.noreply.github.com>
rickgcv
requested review from
jeffmendoza and
spencerschrock
and removed request for
a team
August 11, 2026 09:43
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
isPermissionsErrorcase-insensitive so the helpful error message is always shown whenGITHUB_TOKENlacks branch protection read permission, regardless of API capitalisationclassicBranchErrMsgto name the missing permission (administration:read) and link directly to the fixgenerateTextUnpinnedexplaining how to pin pip dependencies with--require-hashesor a requirements fileFixes #2946
Fixes #2444
Notes
The previous PR #5043 addressed these same issues but went stale and was closed without merging. This picks up that work.
Test plan
make unit-testpasses with no failuresgo test ./clients/githubrepo/... ./probes/pinsDependencies/...passes