-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflows: add scorecards analysis (#4721)
Signed-off-by: Patrick Stephens <[email protected]>
- Loading branch information
1 parent
aa2d8f6
commit 6e6cd1c
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
--- | ||
# https://openssf.org/blog/2022/01/19/reducing-security-risks-in-open-source-software-at-scale-scorecards-launches-v4/ | ||
name: Scorecards supply-chain security | ||
on: | ||
# Only the default branch is supported. | ||
branch_protection_rule: | ||
schedule: | ||
# Weekly on Saturdays. | ||
- cron: '30 1 * * 6' | ||
push: | ||
branches: [ main, master ] | ||
workflow_dispatch: | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
||
jobs: | ||
scorecard-analysis: | ||
name: Scorecards analysis | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Needed to upload the results to code-scanning dashboard. | ||
security-events: write | ||
actions: read | ||
contents: read | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: "Run analysis" | ||
uses: ossf/[email protected] | ||
with: | ||
results_file: results.sarif | ||
results_format: sarif | ||
# Read-only PAT token. To create it, | ||
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation. | ||
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} | ||
# Publish the results for public repositories to enable scorecard badges. For more details, see | ||
# https://github.com/ossf/scorecard-action#publishing-results. | ||
# For private repositories, `publish_results` will automatically be set to `false`, regardless | ||
# of the value entered here. | ||
publish_results: true | ||
|
||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF | ||
# format to the repository Actions tab. | ||
- name: "Upload artifact" | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: SARIF file | ||
path: scorecard-results.sarif | ||
retention-days: 7 | ||
|
||
# Upload the results to GitHub's code scanning dashboard. | ||
- name: "Upload to code-scanning" | ||
uses: github/codeql-action/[email protected] | ||
with: | ||
sarif_file: scorecard-results.sarif |