Skip to content

Commit 4c44145

Browse files
dreamiurgclaude
andauthored
ci: add OpenSSF Scorecard workflow to enable security badge (#47)
* ci: add OpenSSF Scorecard workflow to enable security badge Configures OpenSSF Scorecard analysis to: - Run weekly on Mondays - Publish results to OpenSSF API (enables badge) - Upload SARIF results to GitHub code scanning - Allow manual workflow dispatch This will fix the "invalid repo path" error on the OpenSSF Scorecard badge by actually running the security analysis. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: update GitHub Actions to latest versions - actions/checkout: v4 -> v5 - ossf/scorecard-action: v2.4.0 -> v2.4.3 - github/codeql-action/upload-sarif: v3 -> v4 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent b109c72 commit 4c44145

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: OpenSSF Scorecard
2+
3+
on:
4+
# Run weekly on Monday at 00:00 UTC
5+
schedule:
6+
- cron: '0 0 * * 1'
7+
# Allow manual trigger
8+
workflow_dispatch:
9+
# Run on push to main for initial setup
10+
push:
11+
branches:
12+
- main
13+
14+
# Needed to upload results to code-scanning dashboard
15+
permissions:
16+
contents: read
17+
security-events: write
18+
id-token: write
19+
actions: read
20+
21+
jobs:
22+
analysis:
23+
name: Scorecard analysis
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v5
29+
with:
30+
persist-credentials: false
31+
32+
- name: Run analysis
33+
uses: ossf/scorecard-action@v2.4.3
34+
with:
35+
results_file: results.sarif
36+
results_format: sarif
37+
# Publish results to OpenSSF REST API for the badge
38+
publish_results: true
39+
40+
- name: Upload artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: SARIF file
44+
path: results.sarif
45+
retention-days: 5
46+
47+
- name: Upload to code-scanning
48+
uses: github/codeql-action/upload-sarif@v4
49+
with:
50+
sarif_file: results.sarif

0 commit comments

Comments
 (0)