Skip to content

Commit f8caf3a

Browse files
ci: Add OSSF Scorecard action
This gives use a quick overview of our security.
1 parent 5dfefea commit f8caf3a

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/scorecard.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: '30 4 * * 0'
10+
push:
11+
branches:
12+
- main
13+
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
name: Scorecard analysis
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# Needed to upload the results to code-scanning dashboard.
22+
security-events: write
23+
# Needed to publish results and get a badge (see publish_results below).
24+
id-token: write
25+
26+
steps:
27+
- name: "Checkout code"
28+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
29+
with:
30+
persist-credentials: false
31+
32+
- name: "Run analysis"
33+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
34+
with:
35+
results_file: results.sarif
36+
results_format: sarif
37+
# - Publish results to OpenSSF REST API for easy access by consumers
38+
# - Allows the repository to include the Scorecard badge.
39+
# - See https://github.com/ossf/scorecard-action#publishing-results.
40+
publish_results: true
41+
42+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
43+
# format to the repository Actions tab.
44+
- name: "Upload artifact"
45+
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
46+
with:
47+
name: SARIF file
48+
path: results.sarif
49+
retention-days: 5
50+
51+
# Upload the results to GitHub's code scanning dashboard (optional).
52+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
53+
- name: "Upload to code-scanning"
54+
uses: github/codeql-action/upload-sarif@v3
55+
with:
56+
sarif_file: results.sarif
57+

0 commit comments

Comments
 (0)