Skip to content

Commit 546d17c

Browse files
authored
Create scorecards.yml
1 parent bf09939 commit 546d17c

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/scorecards.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Scorecards supply-chain security
2+
on:
3+
# Only the default branch is supported.
4+
branch_protection_rule:
5+
schedule:
6+
- cron: '42 6 * * 0'
7+
push:
8+
branches: [ main ]
9+
workflow_dispatch:
10+
11+
# Declare default permissions as read only.
12+
permissions: read-all
13+
14+
jobs:
15+
analysis:
16+
name: Scorecards analysis
17+
runs-on: ubuntu-latest
18+
permissions:
19+
# Needed to upload the results to code-scanning dashboard.
20+
security-events: write
21+
actions: read
22+
contents: read
23+
24+
steps:
25+
- name: "Checkout code"
26+
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
27+
with:
28+
persist-credentials: false
29+
30+
- name: "Run analysis"
31+
uses: ossf/scorecard-action@c1aec4ac820532bab364f02a81873c555a0ba3a1 # v1.0.4
32+
with:
33+
results_file: results.sarif
34+
results_format: sarif
35+
# Read-only PAT token. To create it,
36+
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
37+
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
38+
# Publish the results to enable scorecard badges. For more details, see
39+
# https://github.com/ossf/scorecard-action#publishing-results.
40+
# For private repositories, `publish_results` will automatically be set to `false`,
41+
# regardless of the value entered here.
42+
publish_results: true
43+
44+
# Upload the results as artifacts (optional).
45+
- name: "Upload artifact"
46+
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
47+
with:
48+
name: SARIF file
49+
path: results.sarif
50+
retention-days: 5
51+
52+
# Upload the results to GitHub's code scanning dashboard.
53+
- name: "Upload to code-scanning"
54+
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26
55+
with:
56+
sarif_file: results.sarif

0 commit comments

Comments
 (0)