Skip to content

Commit d479117

Browse files
committed
Add workflow to run OpenSSF scorecard checks
1 parent 4684bd4 commit d479117

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: OpenSSF Scorecard supply-chain security analysis
2+
3+
on:
4+
branch_protection_rule:
5+
schedule:
6+
- cron: '31 20 * * 6'
7+
push:
8+
branches: [ "main" ]
9+
10+
permissions: read-all
11+
12+
jobs:
13+
analysis:
14+
name: Scorecard analysis
15+
runs-on: ubuntu-latest
16+
permissions:
17+
# Needed to upload the results to code-scanning dashboard.
18+
security-events: write
19+
# Needed to publish results and get a badge (see publish_results below).
20+
id-token: write
21+
22+
steps:
23+
- name: "Checkout code"
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
with:
26+
persist-credentials: false
27+
28+
- name: "Run analysis"
29+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
30+
with:
31+
results_file: results.sarif
32+
results_format: sarif
33+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
34+
# - you want to enable the Branch-Protection check on a *public* repository, or
35+
# - you are installing Scorecard on a *private* repository
36+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
37+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
38+
39+
# Public repositories:
40+
# - Publish results to OpenSSF REST API for easy access by consumers
41+
# - Allows the repository to include the Scorecard badge.
42+
# - See https://github.com/ossf/scorecard-action#publishing-results.
43+
# For private repositories:
44+
# - `publish_results` will always be set to `false`, regardless
45+
# of the value entered here.
46+
publish_results: true
47+
48+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
49+
# format to the repository Actions tab.
50+
- name: "Upload artifact"
51+
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
52+
with:
53+
name: SARIF file
54+
path: results.sarif
55+
retention-days: 5
56+
57+
# Upload the results to GitHub's code scanning dashboard (optional).
58+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
59+
- name: "Upload to code-scanning"
60+
uses: github/codeql-action/upload-sarif@v3
61+
with:
62+
sarif_file: results.sarif

0 commit comments

Comments
 (0)