Skip to content

Commit 2b2c14d

Browse files
authored
Merge pull request #3 from github/ossf-scorecard-workflow
Create OpenSSF Scorecard workflow
2 parents 26718f7 + 70ad903 commit 2b2c14d

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '42 17 * * 5'
14+
push:
15+
branches: [ "main" ]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# Needed for Code scanning upload
26+
security-events: write
27+
# Needed for GitHub OIDC token if publish_results is true
28+
id-token: write
29+
30+
steps:
31+
- name: "Checkout code"
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
with:
34+
persist-credentials: false
35+
36+
- name: "Run analysis"
37+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
38+
with:
39+
results_file: results.sarif
40+
results_format: sarif
41+
# Scorecard team runs a weekly scan of public GitHub repos,
42+
# see https://github.com/ossf/scorecard#public-data.
43+
# Setting `publish_results: true` helps us scale by leveraging your workflow to
44+
# extract the results instead of relying on our own infrastructure to run scans.
45+
# And it's free for you!
46+
publish_results: true
47+
48+
# Upload the results as artifacts (optional). Commenting out will disable
49+
# uploads of run results in SARIF format to the repository Actions tab.
50+
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
51+
- name: "Upload artifact"
52+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
53+
with:
54+
name: SARIF file
55+
path: results.sarif
56+
retention-days: 5
57+
58+
# Upload the results to GitHub's code scanning dashboard (optional).
59+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
60+
- name: "Upload to code-scanning"
61+
uses: github/codeql-action/upload-sarif@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
62+
with:
63+
sarif_file: results.sarif

0 commit comments

Comments
 (0)