Files
starter-workflows/code-scanning/scorecards.yml
T

56 lines
1.9 KiB
YAML
Raw Normal View History

2021-12-10 17:49:59 +00:00
name: Scorecards supply-chain security
2022-01-14 03:00:11 +00:00
on:
2021-12-10 17:49:59 +00:00
# Only the default branch is supported.
branch_protection_rule:
schedule:
2021-12-16 18:25:53 +00:00
- cron: $cron-weekly
2021-12-10 17:49:59 +00:00
push:
branches: [ $default-branch ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
2022-01-10 23:19:46 +00:00
actions: read
contents: read
2022-01-14 03:00:11 +00:00
2021-12-10 17:49:59 +00:00
steps:
- name: "Checkout code"
2021-12-28 17:49:56 +00:00
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
with:
persist-credentials: false
2021-12-10 17:49:59 +00:00
- name: "Run analysis"
2022-01-24 08:27:33 -08:00
uses: ossf/scorecard-action@c8416b0b2bf627c349ca92fc8e3de51a64b005cf # v1.0.2
2021-12-10 17:49:59 +00:00
with:
results_file: results.sarif
results_format: sarif
2021-12-29 23:02:46 +00:00
# Read-only PAT token. To create it,
2021-12-29 23:11:08 +00:00
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
2022-01-10 23:52:58 +00:00
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
2021-12-29 23:02:46 +00:00
# Publish the results to enable scorecard badges. For more details, see
2021-12-29 23:11:08 +00:00
# https://github.com/ossf/scorecard-action#publishing-results.
2022-01-14 03:00:11 +00:00
# For private repositories, `publish_results` will automatically be set to `false`,
# regardless of the value entered here.
2021-12-10 17:49:59 +00:00
publish_results: true
2021-12-29 22:56:18 +00:00
# Upload the results as artifacts (optional).
2021-12-10 17:49:59 +00:00
- name: "Upload artifact"
2021-12-28 17:49:56 +00:00
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1
2021-12-10 17:49:59 +00:00
with:
name: SARIF file
path: results.sarif
retention-days: 5
2022-01-14 03:00:11 +00:00
2021-12-10 17:49:59 +00:00
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
2021-12-28 17:49:56 +00:00
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26
2021-12-10 17:49:59 +00:00
with:
sarif_file: results.sarif