ci(queue): gate Scorecard on repository visibility (green while private) - #8
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Scorecard GitHub Actions workflow to avoid recurring failures in private repositories by gating the OpenSSF Scorecard analysis on repository visibility, keeping runs green until the repository becomes public.
Changes:
- Add a
gatejob that resolvesrepos/<repo>.visibilityvia the GitHub API. - Run the
analysisjob only when the gate reports the repository is public.
Comments suppressed due to low confidence (1)
.github/workflows/scorecard.yml:51
analysisdefines job-levelpermissions, which overrides the workflow-level defaults. Since this job runsactions/checkout, it should explicitly includecontents: read(consistent with other workflows like.github/workflows/codeql.yml). Without it, checkout can fail depending on how the token is used.
needs: gate
if: ${{ needs.gate.outputs.public == 'true' }}
runs-on: ubuntu-latest
permissions:
security-events: write
id-token: write
steps:
Member
Author
|
Addressed in the latest commit — the visibility check is now fail-safe: |
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.
Root cause of the recurring Scorecard failure: OpenSSF Scorecard requires a public repository — its checkout cannot authenticate against this private repo (
fatal: repository not found). The earlier checkout-v4 pin only surfaced the underlying private-repo limitation.Apply the same visibility-gate pattern already used for the CodeQL SARIF upload: a small
gatejob resolvesrepos/<repo>.visibilityvia the API; theanalysisjob runs onlyif: needs.gate.outputs.public == 'true'. While private, the analysis is skipped (the run stays green); once the repository is made public, Scorecard runs automatically — no further workflow change.This matches the project decision to configure everything as if public, with a conditional for what cannot run while private.