Skip to content

Commit eb6472d

Browse files
ci(github): create workflow scorecard.yml
1 parent 3956ec3 commit eb6472d

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/scorecard.yml

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

0 commit comments

Comments
 (0)