Skip to content

Commit 917f4d0

Browse files
chore(StepSecurity): Add OpenSSF Scorecard Workflow (#780)
### Add OpenSSF Scorecard Workflow OpenSSF Scorecard is an automated tool that assesses a number of important heuristics ("checks") associated with software security and assigns each check a score of 0-10. You can use these scores to understand specific areas to improve in order to strengthen the security posture of your project. Scorecard workflow also allows maintainers to display a Scorecard badge on their repository to show off their hard work. - [The Open Source Security Foundation (OpenSSF) Scorecard](https://github.com/ossf/scorecard) --------- Signed-off-by: StepSecurity Bot <[email protected]> Co-authored-by: StepSecurity Bot <[email protected]>
1 parent 911e9ce commit 917f4d0

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

.github/workflows/scorecards.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
# This workflow uses actions that are not certified by GitHub. They are
3+
# provided by a third-party and are governed by separate terms of service,
4+
# privacy policy, and support documentation.
5+
6+
name: Scorecard supply-chain security
7+
on:
8+
# For Branch-Protection check. Only the default branch is supported. See
9+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
10+
branch_protection_rule:
11+
# To guarantee Maintained check is occasionally updated. See
12+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
13+
schedule:
14+
- cron: 20 7 * * 2
15+
push:
16+
branches:
17+
- master
18+
19+
# Declare default permissions as read only.
20+
permissions: read-all
21+
22+
jobs:
23+
analysis:
24+
name: Scorecard analysis
25+
runs-on: ubuntu-latest
26+
permissions:
27+
# Needed to upload the results to code-scanning dashboard.
28+
security-events: write
29+
# Needed to publish results and get a badge (see publish_results below).
30+
id-token: write
31+
contents: read
32+
actions: read
33+
# To allow GraphQL ListCommits to work
34+
issues: read
35+
pull-requests: read
36+
# To detect SAST tools
37+
checks: read
38+
39+
steps:
40+
- name: Checkout code
41+
# yamllint disable-line rule:line-length
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
with:
44+
persist-credentials: false
45+
46+
- name: Run analysis
47+
# yamllint disable-line rule:line-length
48+
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
49+
with:
50+
results_file: results.sarif
51+
results_format: sarif
52+
# (Optional) "write" PAT token. Uncomment the `repo_token` line if:
53+
# - you want to enable the Branch-Protection check on a *public*
54+
# repository, or
55+
# - you are installing Scorecards on a *private* repository
56+
# To create the PAT, follow the steps in
57+
# https://github.com/ossf/scorecard-action#authentication-with-pat.
58+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
59+
60+
# Public repositories:
61+
# - Publish results to OpenSSF REST API for easy access by consumers
62+
# - Allows the repository to include the Scorecard badge.
63+
# - See https://github.com/ossf/scorecard-action#publishing-results.
64+
# For private repositories:
65+
# - `publish_results` will always be set to `false`, regardless
66+
# of the value entered here.
67+
publish_results: true
68+
69+
# Upload the results as artifacts (optional). Commenting out will disable
70+
# uploads of run results in SARIF format to the repository Actions tab.
71+
- name: Upload artifact
72+
# yamllint disable-line rule:line-length
73+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
74+
with:
75+
name: SARIF file
76+
path: results.sarif
77+
retention-days: 5
78+
79+
# Upload the results to GitHub's code scanning dashboard.
80+
- name: Upload to code-scanning
81+
# yamllint disable-line rule:line-length
82+
uses: github/codeql-action/upload-sarif@ee117c905ab18f32fa0f66c2fe40ecc8013f3e04 # v3.28.4
83+
with:
84+
sarif_file: results.sarif

0 commit comments

Comments
 (0)