Skip to content

Commit a1ff163

Browse files
committed
build: fix scorecard action signing
First of all, scorecard does not print a useful error at all. Looking through issues and their verify workflow logic, it seems like the permissions for the scorecard action workflow *need* to be set on the actual job itself, while the workflow-level permissions *cannot* contain any `write` permissions. We already got further with the errors by enabling id-token write properly, but now the signing fails with an unknown error that we attempt to fix using this commit.
1 parent a786616 commit a1ff163

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/scorecard.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ on:
77
branches: [main]
88
workflow_dispatch:
99

10-
permissions:
11-
actions: read
12-
contents: read
13-
# Needed to upload the results to code-scanning dashboard.
14-
security-events: write
15-
# Needed for signing and publishing of results for the badge.
16-
id-token: write
10+
# Declare default permissions as read only.
11+
permissions: read-all
1712

1813
jobs:
1914
analysis:
2015
name: Scorecards analysis
2116
runs-on: ubuntu-latest
17+
permissions:
18+
actions: read
19+
contents: read
20+
# Needed to upload the results to code-scanning dashboard.
21+
security-events: write
22+
# Needed for signing and publishing of results for the badge.
23+
id-token: write
2224
steps:
2325
- name: 'Checkout code'
2426
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3.2.0

0 commit comments

Comments
 (0)