1
+ name : Scorecard supply-chain security
2
+ on :
3
+ # For Branch-Protection check. Only the default branch is supported. See
4
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5
+ branch_protection_rule :
6
+ pull_request :
7
+ branches : [ "main" ]
8
+
9
+ # Declare default permissions as read only.
10
+ permissions : read-all
11
+
12
+ jobs :
13
+ analysis :
14
+ name : Scorecard analysis
15
+ runs-on : ubuntu-latest
16
+ permissions :
17
+ # Needed to upload the results to code-scanning dashboard.
18
+ security-events : write
19
+ # Needed to publish results and get a badge (see publish_results below).
20
+ id-token : write
21
+
22
+ steps :
23
+ - name : " Checkout code"
24
+ uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
25
+ with :
26
+ persist-credentials : false
27
+
28
+ - name : " Run analysis"
29
+ uses : ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
30
+ with :
31
+ results_file : results.sarif
32
+ results_format : sarif
33
+ # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
34
+ # - you want to enable the Branch-Protection check on a *public* repository, or
35
+ # - you are installing Scorecard on a *private* repository
36
+ # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
37
+ # repo_token: ${{ secrets.SCORECARD_TOKEN }}
38
+
39
+ # Public repositories:
40
+ # - Publish results to OpenSSF REST API for easy access by consumers
41
+ # - Allows the repository to include the Scorecard badge.
42
+ # - See https://github.com/ossf/scorecard-action#publishing-results.
43
+ publish_results : true
44
+
45
+ # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
46
+ # format to the repository Actions tab.
47
+ - name : " Upload artifact"
48
+ uses : actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
49
+ with :
50
+ name : SARIF file
51
+ path : results.sarif
52
+ retention-days : 5
53
+
54
+ # Upload the results to GitHub's code scanning dashboard.
55
+ - name : " Upload to code-scanning"
56
+ uses : github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
57
+ with :
58
+ sarif_file : results.sarif
0 commit comments