Skip to content

Commit 2f828aa

Browse files
ci(security): add openssf scorecard (#971)
Close #969 --------- Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
1 parent 4c32021 commit 2f828aa

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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: '35 6 * * 1'
10+
push:
11+
branches: [ "main" ]
12+
workflow_dispatch:
13+
14+
# Declare default permissions as read only.
15+
permissions: read-all
16+
17+
jobs:
18+
analysis:
19+
name: Scorecard analysis
20+
runs-on: ubuntu-latest
21+
permissions:
22+
# Needed to upload the results to code-scanning dashboard.
23+
security-events: write
24+
# Needed to publish results and get a badge (see publish_results below).
25+
id-token: write
26+
27+
steps:
28+
- name: Harden Runner
29+
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
30+
with:
31+
egress-policy: audit
32+
33+
- name: "Checkout code"
34+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
35+
with:
36+
persist-credentials: false
37+
38+
- name: "Run analysis"
39+
uses: ossf/scorecard-action@99c09fe975337306107572b4fdf4db224cf8e2f2 # v2.4.3
40+
with:
41+
results_file: results.sarif
42+
results_format: sarif
43+
publish_results: true
44+
45+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
46+
# format to the repository Actions tab.
47+
- name: "Upload artifact"
48+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
49+
with:
50+
name: SARIF file
51+
path: results.sarif
52+
retention-days: 5
53+
54+
# Upload the results to GitHub's code scanning dashboard (optional).
55+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
56+
- name: "Upload to code-scanning"
57+
uses: github/codeql-action/upload-sarif@fb0994ef1c058010acf1efccff928b0a83b1ed54 # v4.32.6
58+
with:
59+
sarif_file: results.sarif

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This is the source code for https://jsr.io, the new JavaScript registry.
1313
1414
## Project Information
1515

16+
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/jsr-io/jsr/badge)](https://scorecard.dev/viewer/?uri=github.com/jsr-io/jsr)
17+
1618
**Goals**
1719

1820
- Robust

0 commit comments

Comments
 (0)