Skip to content

Commit 190cbf6

Browse files
committed
add scorecard to main branch
1 parent 2c1d220 commit 190cbf6

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: OpenSSF Scorecard
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+
push:
9+
branches: [ main ]
10+
11+
permissions: read-all
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+
21+
steps:
22+
- name: "Checkout code"
23+
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
26+
27+
- name: "Run analysis"
28+
uses: ossf/[email protected]
29+
with:
30+
results_file: results.sarif
31+
results_format: sarif
32+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
33+
# - you want to enable the Branch-Protection check on a *public* repository, or
34+
# - you are installing Scorecard on a *private* repository
35+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
36+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
37+
38+
# Public repositories:
39+
# - Publish results to OpenSSF REST API for easy access by consumers
40+
# - Allows the repository to include the Scorecard badge.
41+
# - See https://github.com/ossf/scorecard-action#publishing-results.
42+
# For private repositories:
43+
# - `publish_results` will always be set to `false`, regardless
44+
# of the value entered here.
45+
publish_results: true
46+
47+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
48+
# format to the repository Actions tab.
49+
- name: "Upload artifact"
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: SARIF file
53+
path: results.sarif
54+
retention-days: 5
55+
56+
# Upload the results to GitHub's code scanning dashboard (optional).
57+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
58+
- name: "Upload to code-scanning"
59+
uses: github/codeql-action/upload-sarif@v3
60+
with:
61+
sarif_file: results.sarif

0 commit comments

Comments
 (0)