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