Skip to content

Commit d488086

Browse files
tylerauerbecktekton-robot
authored andcommitted
add scorecard workflow
Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
1 parent abf13a2 commit d488086

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/scorecard.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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: '23 0 * * 4'
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 to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write
29+
30+
steps:
31+
- name: Harden Runner
32+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
33+
with:
34+
egress-policy: audit
35+
- name: "Checkout code"
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
with:
38+
persist-credentials: false
39+
40+
- name: "Run analysis"
41+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
42+
with:
43+
results_file: results.sarif
44+
results_format: sarif
45+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
46+
47+
# Public repositories:
48+
# - Publish results to OpenSSF REST API for easy access by consumers
49+
# - Allows the repository to include the Scorecard badge.
50+
# - See https://github.com/ossf/scorecard-action#publishing-results.
51+
publish_results: true
52+
53+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
54+
# format to the repository Actions tab.
55+
- name: "Upload artifact"
56+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
57+
with:
58+
name: SARIF file
59+
path: results.sarif
60+
retention-days: 5
61+
62+
# Upload the results to GitHub's code scanning dashboard.
63+
- name: "Upload to code-scanning"
64+
uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
65+
with:
66+
sarif_file: results.sarif

0 commit comments

Comments
 (0)