11# This workflow uses actions that are not certified by GitHub. They are provided
22# by a third-party and are governed by separate terms of service, privacy
33# policy, and support documentation.
4-
54name : Scorecard supply-chain security
65on :
76 # For Branch-Protection check. Only the default branch is supported. See
1312 - cron : ' 45 1 * * 4'
1413 push :
1514 branches : [ "master" ]
16-
1715 workflow_dispatch :
18-
1916# Declare default permissions as read only.
2017permissions : read-all
21-
2218jobs :
2319 analysis :
2420 name : Scorecard analysis
@@ -30,36 +26,29 @@ jobs:
3026 security-events : write
3127 # Needed to publish results and get a badge (see publish_results below).
3228 id-token : write
33-
3429 steps :
3530 - name : " Checkout code"
3631 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3732 with :
3833 persist-credentials : false
39-
4034 - name : " Run analysis"
4135 uses : ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
4236 with :
4337 results_file : results.sarif
4438 results_format : sarif
45- # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
46- # - you want to enable the Branch-Protection check on a *public* repository, or
47- # - you are installing Scorecard on a *private* repository
39+ # PAT token for Branch-Protection check access.
4840 # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
49- # repo_token: ${{ secrets.SCORECARD_TOKEN }}
50-
41+ repo_token : ${{ secrets.SCORECARD_TOKEN }}
5142 # Public repositories:
5243 # - Publish results to OpenSSF REST API for easy access by consumers
5344 # - Allows the repository to include the Scorecard badge.
5445 # - See https://github.com/ossf/scorecard-action#publishing-results.
5546 # For private repositories:
5647 # - `publish_results` will always be set to `false`, regardless
5748 # of the value entered here.
58- publish_results : true
59-
49+ publish_results : ${{ github.event.repository.default_branch == github.ref_name }}
6050 # (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
6151 # file_mode: git
62-
6352 # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6453 # format to the repository Actions tab.
6554 - name : " Upload artifact"
6857 name : SARIF file
6958 path : results.sarif
7059 retention-days : 5
71-
7260 # Upload the results to GitHub's code scanning dashboard (optional).
7361 # Commenting out will disable upload of results to your repo's Code Scanning dashboard
7462 - name : " Upload to code-scanning"
0 commit comments