Skip to content

Commit 105a96a

Browse files
creed-brattonbfabio
authored andcommitted
ci: add OpenSSF Scorecard workflow
Runs weekly and on every push to main. Publishes results to the public Scorecard dashboard and uploads SARIF to the GitHub Security tab. Requires the repo to have GitHub Advanced Security enabled (free for public repos) and the maintainer to confirm publish_results: true.
1 parent 3393e85 commit 105a96a

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/scorecard.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: OpenSSF Scorecard
2+
3+
on:
4+
branch_protection_rule:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
- cron: "30 1 * * 1"
10+
11+
permissions: {}
12+
13+
jobs:
14+
analysis:
15+
name: Scorecard analysis
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write
19+
id-token: write
20+
contents: read
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
25+
with:
26+
persist-credentials: false
27+
28+
- name: Run analysis
29+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
30+
with:
31+
results_file: results.sarif
32+
results_format: sarif
33+
publish_results: true
34+
35+
- name: Upload artifact
36+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
37+
with:
38+
name: SARIF file
39+
path: results.sarif
40+
retention-days: 5
41+
42+
- name: Upload to code-scanning
43+
uses: github/codeql-action/upload-sarif@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3
44+
with:
45+
sarif_file: results.sarif

0 commit comments

Comments
 (0)