Skip to content

Commit 3f95d71

Browse files
authored
Add Scorecard Action (#2267)
Signed-off-by: Pedro Kaj Kjellerup Nacht <[email protected]>
1 parent 7f95b92 commit 3f95d71

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
schedule:
9+
- cron: "37 4 * * 6"
10+
push:
11+
branches: [ "master" ]
12+
13+
permissions: read-all
14+
15+
jobs:
16+
analysis:
17+
name: Scorecard analysis
18+
runs-on: ubuntu-latest
19+
permissions:
20+
# Needed to upload the results to code-scanning dashboard.
21+
security-events: write
22+
# Needed to publish results and get a badge (see publish_results below).
23+
id-token: write
24+
25+
steps:
26+
- name: "Checkout code"
27+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28+
with:
29+
persist-credentials: false
30+
31+
- name: "Run analysis"
32+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
33+
with:
34+
results_file: results.sarif
35+
results_format: sarif
36+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if
37+
# you want to enable the Branch-Protection check on a *public* repository.
38+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
39+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
40+
41+
# Publish results to OpenSSF REST API for easy access by consumers.
42+
# See https://github.com/ossf/scorecard-action#publishing-results.
43+
publish_results: true
44+
45+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
46+
# format to the repository Actions tab.
47+
- name: "Upload artifact"
48+
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
49+
with:
50+
name: SARIF file
51+
path: results.sarif
52+
retention-days: 5
53+
54+
# Upload the results to GitHub's code scanning dashboard.
55+
- name: "Upload to code-scanning"
56+
uses: github/codeql-action/upload-sarif@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
57+
with:
58+
sarif_file: results.sarif

0 commit comments

Comments
 (0)