fix: Update scorecard workflow (#24457)

This commit is contained in:
Antonis Stamatiou 2023-09-04 13:49:49 +03:00 committed by GitHub
parent 5443f9d371
commit dfbe0c14e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,45 +3,52 @@ on:
# Only the default branch is supported. # Only the default branch is supported.
branch_protection_rule: branch_protection_rule:
schedule: schedule:
- cron: '44 6 * * *' - cron: "44 6 * * *"
# Declare default permissions as read only. # Declare default permissions as read only.
permissions: read-all permissions: read-all
jobs: jobs:
analysis: analysis:
name: Scorecards analysis name: Scorecard analysis
if: github.repository_owner == 'mattermost' if: github.repository_owner == 'mattermost'
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
# Needed to upload the results to code-scanning dashboard. # Needed to upload the results to code-scanning dashboard.
security-events: write security-events: write
actions: read # Needed to publish results and get a badge (see publish_results below).
contents: read id-token: write
steps: steps:
- name: "Checkout code" - name: "Checkout code"
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0 uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with: with:
persist-credentials: false persist-credentials: false
- name: "Run analysis" - name: "Run analysis"
uses: ossf/scorecard-action@c1aec4ac820532bab364f02a81873c555a0ba3a1 # v1.0.4 uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
with: with:
results_file: results.sarif results_file: results.sarif
results_format: sarif results_format: sarif
# Read-only PAT token. To create it, # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation. # - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
# Publish the results to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results. # Public repositories:
# For private repositories, `publish_results` will automatically be set to `false`, # - Publish results to OpenSSF REST API for easy access by consumers
# regardless of the value entered here. # - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true publish_results: true
# Upload the results as artifacts (optional). # 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" - name: "Upload artifact"
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1 uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with: with:
name: SARIF file name: SARIF file
path: results.sarif path: results.sarif
@ -49,6 +56,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard. # Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning" - name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26 uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
with: with:
sarif_file: results.sarif sarif_file: results.sarif