Skip to content

Run Scorecard best-practices analyzer #1

Run Scorecard best-practices analyzer

Run Scorecard best-practices analyzer #1

Workflow file for this run

# Zero-configuration modular workflow to run the OSSF Scorecard scanner.
#
# Scorecard (https://github.com/ossf/scorecard) is a repository-scanning tool
# that evaluates a project's security practices. Its use is suggested by
# Google's GitHub team. Scorecard's findings are reported in a repo's scanning
# results page, https://github.com/quantumlib/REPO/security/code-scanning/.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
name: Scorecard analysis
run-name: Run Scorecard best-practices analyzer ${{inputs.reason}}
on:
pull_request:
types: [opened, synchronize]
branches:
- main
- master
# Support merge queues.
merge_group:
types:
- checks_requested
# Allow manual invocation.
workflow_dispatch:
# Allow calling from nightly.yaml.
workflow_call:
inputs:
reason:
type: string
# Declare default permissions as read only.
permissions: read-all
jobs:
scorecard:
name: Run Scorecard analyzer
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions: write-all
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Run Scorecard analysis
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
with:
# Save the results
results_file: results.sarif
results_format: sarif
# Publish results to OpenSSF REST API.
# See https://github.com/ossf/scorecard-action#publishing-results.
publish_results: true
- name: Upload results to code-scanning dashboard
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3
with:
sarif_file: results.sarif