Run Scorecard code scan #15
This file contains hidden or 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
# Copyright 2025 Google LLC | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# 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 code scan | |
run-name: Run Scorecard code scan | |
on: | |
schedule: | |
- cron: '19 20 * * 6' | |
# Allow manual invocation. | |
workflow_dispatch: | |
# Declare default permissions as read only. | |
permissions: read-all | |
# Cancel any previously-started but still active runs on the same branch. | |
concurrency: | |
cancel-in-progress: true | |
group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}} | |
jobs: | |
scorecard: | |
name: Perform Scorecard analysis | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
permissions: | |
# Needed to upload the results to the code-scanning dashboard. | |
security-events: write | |
# Needed to publish results and get a badge (see publish_results below). | |
id-token: write | |
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 |