Skip to content

Commit ccdc289

Browse files
committed
chore: add OpenSSF Scorecard GitHub Action
1 parent 9a92dc4 commit ccdc289

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: OpenSSF Scorecard
2+
3+
on:
4+
# Run on pushes to main/master branch
5+
push:
6+
branches: [master, main]
7+
# Run weekly on Monday at 00:00 UTC
8+
schedule:
9+
- cron: '0 0 * * 1'
10+
# Allow manual triggering
11+
workflow_dispatch:
12+
13+
# Declare default permissions as read only
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
name: Scorecard analysis
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# Needed for Code Scanning upload
22+
security-events: write
23+
# Needed for GitHub OIDC token
24+
id-token: write
25+
# Needed for Scorecard to read repo contents
26+
contents: read
27+
# Needed for Scorecard to read repo metadata
28+
actions: read
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
with:
34+
persist-credentials: false
35+
36+
- name: Run OpenSSF Scorecard
37+
uses: ossf/[email protected]
38+
with:
39+
results_file: results.sarif
40+
results_format: sarif
41+
# Publish results to OpenSSF REST API
42+
# This allows the badge to be displayed on the repo
43+
publish_results: true
44+
45+
- name: Upload Scorecard results to GitHub Security tab
46+
uses: github/codeql-action/upload-sarif@v3
47+
with:
48+
sarif_file: results.sarif

0 commit comments

Comments
 (0)