1+ # This workflow uses actions that are not certified by GitHub. They are provided
2+ # by a third-party and are governed by separate terms of service, privacy
3+ # policy, and support documentation.
4+
5+ name : Scorecard supply-chain security
6+ on :
7+ pull_request :
8+ push :
9+ branches :
10+ - main
11+
12+ # Declare default permissions as read only.
13+ permissions : read-all
14+
15+ jobs :
16+ analysis :
17+ name : Scorecard analysis
18+ runs-on : ubuntu-latest
19+ # `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
20+ if : github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
21+ permissions :
22+ # Needed to upload the results to code-scanning dashboard.
23+ security-events : write
24+ # Needed to publish results and get a badge (see publish_results below).
25+ id-token : write
26+ # Uncomment the permissions below if installing in a private repository.
27+ # contents: read
28+ # actions: read
29+
30+ steps :
31+ - name : " Checkout code"
32+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+ with :
34+ persist-credentials : false
35+
36+ - name : " Run analysis"
37+ uses : ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
38+ with :
39+ results_file : results.sarif
40+ results_format : sarif
41+ # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
42+ # - you want to enable the Branch-Protection check on a *public* repository, or
43+ # - you are installing Scorecard on a *private* repository
44+ # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
45+ # repo_token: ${{ secrets.SCORECARD_TOKEN }}
46+
47+ # Public repositories:
48+ # - Publish results to OpenSSF REST API for easy access by consumers
49+ # - Allows the repository to include the Scorecard badge.
50+ # - See https://github.com/ossf/scorecard-action#publishing-results.
51+ # For private repositories:
52+ # - `publish_results` will always be set to `false`, regardless
53+ # of the value entered here.
54+ publish_results : true
55+
56+ # (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
57+ # file_mode: git
58+
59+ # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
60+ # format to the repository Actions tab.
61+ - name : " Upload artifact"
62+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
63+ with :
64+ name : SARIF file
65+ path : results.sarif
66+ retention-days : 5
67+
68+ # Upload the results to GitHub's code scanning dashboard (optional).
69+ # Commenting out will disable upload of results to your repo's Code Scanning dashboard
70+ - name : " Upload to code-scanning"
71+ uses : github/codeql-action/upload-sarif@v3
72+ with :
73+ sarif_file : results.sarif
0 commit comments