Scorecard supply-chain security #386
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
name: Scorecard supply-chain security | |
on: | |
# For Branch-Protection check. Only the default branch is supported. See | |
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection | |
branch_protection_rule: | |
# To guarantee Maintained check is occasionally updated. See | |
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained | |
schedule: | |
- cron: '0 */12 * * *' | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
# Declare default permissions as read only. | |
permissions: read-all | |
jobs: | |
analysis: | |
name: Scorecard analysis | |
runs-on: ubuntu-latest | |
permissions: | |
# Needed to upload the results to code-scanning dashboard. | |
security-events: write | |
# Needed to publish results and get a badge (see publish_results below). | |
id-token: write | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
api.osv.dev:443 | |
api.securityscorecards.dev:443 | |
bestpractices.coreinfrastructure.org:443 | |
fulcio.sigstore.dev:443 | |
github.com:443 | |
oss-fuzz-build-logs.storage.googleapis.com:443 | |
sigstore-tuf-root.storage.googleapis.com:443 | |
rekor.sigstore.dev:443 | |
- name: "Checkout code" | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
persist-credentials: false | |
- name: "Run analysis" | |
uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3 | |
with: | |
results_file: results.sarif | |
results_format: sarif | |
# Public repositories: | |
# - Publish results to OpenSSF REST API for easy access by consumers | |
# - Allows the repository to include the Scorecard badge. | |
# - See https://github.com/ossf/scorecard-action#publishing-results. | |
publish_results: true | |
# Upload the results to GitHub's code scanning dashboard. | |
- name: "Upload to code-scanning" | |
uses: github/codeql-action/upload-sarif@f3feb00acb00f31a6f60280e6ace9ca31d91c76a # v2.3.2 | |
with: | |
sarif_file: results.sarif |