-
-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OpenSSF Scorecards GitHub Action (#1795)
Signed-off-by: Matthieu MOREL <[email protected]> Co-authored-by: Manuel de la Peña <[email protected]>
- Loading branch information
1 parent
caaf25a
commit e52cd03
Showing
4 changed files
with
84 additions
and
10 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
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
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,56 @@ | ||
name: Scorecard analysis workflow | ||
on: | ||
# Only the default branch is supported. | ||
branch_protection_rule: | ||
push: | ||
branches: [ main ] | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
||
jobs: | ||
analysis: | ||
name: Scorecard analysis | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Needed if using Code scanning alerts | ||
security-events: write | ||
# Needed for GitHub OIDC token if publish_results is true | ||
id-token: write | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: "Run analysis" | ||
uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3 | ||
with: | ||
results_file: results.sarif | ||
results_format: sarif | ||
# (Optional) fine-grained personal access token. Uncomment the `repo_token` line below if: | ||
# - you want to enable the Branch-Protection check on a *public* repository, or | ||
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-fine-grained-pat-optional. | ||
# repo_token: ${{ secrets.SCORECARD_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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | ||
with: | ||
name: SARIF file | ||
path: results.sarif | ||
retention-days: 5 | ||
|
||
# required for Code scanning alerts | ||
- name: "Upload SARIF results to code scanning" | ||
uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6 | ||
with: | ||
sarif_file: results.sarif |
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