Skip to content

Commit 138ae99

Browse files
authored
ci: drop contents and actions read from the scorecard job (#97)
Both are private-repository permissions and this repo is public. The only Actions API call Scorecard makes is ListWorkflowRunsByFileName, from the Packaging and Binary-Artifacts checks. That endpoint is publicly readable: requesting it for a public repo with no authentication at all returns 200. Upstream's starter workflow ships `contents: read` and `actions: read` commented out under "uncomment if installing in a private repository", and OSSF runs Scorecard on its own public repos -- ossf/scorecard and ossf/scorecard-action -- with `security-events: write` and `id-token: write` alone. Those runs are green and score Packaging 10, Binary-Artifacts 10 and CI-Tests 10, which is the same evidence for dropping `contents: read`: their checkout step works without it. Follows #94, which merged before this was raised in review on qBraid/pyqasm#412.
1 parent 53da882 commit 138ae99

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

.github/workflows/scorecard.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ jobs:
2727
permissions:
2828
security-events: write # upload SARIF to code scanning
2929
id-token: write # publish results to the public Scorecard API
30-
contents: read
31-
# Lets Scorecard read workflow definitions and run history. Documented by the
32-
# upstream starter workflow as required for private repositories; this repo is
33-
# public, so it is retained only as a safeguard should that ever change.
34-
actions: read
30+
# `contents: read` and `actions: read` are deliberately absent. Upstream ships both
31+
# commented out, needed only for private repositories, and OSSF runs Scorecard on its
32+
# own public repos with exactly the two permissions above.
3533

3634
# Actions are pinned to full commit SHAs: a tag is mutable and can be repointed at
3735
# other code, which is what Scorecard's own Pinned-Dependencies check looks for.

0 commit comments

Comments
 (0)