|
1 | | -name: Scorecards supply-chain security |
| 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 |
2 | 6 | on: |
3 | | - # Only the default branch is supported. |
| 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 |
4 | 9 | branch_protection_rule: |
| 10 | + # To guarantee Maintained check is occasionally updated. See |
| 11 | + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained |
5 | 12 | schedule: |
6 | 13 | - cron: '18 9 * * 5' |
7 | 14 | push: |
8 | | - branches: [ master ] |
| 15 | + branches: [ "master" ] |
9 | 16 |
|
10 | 17 | # Declare default permissions as read only. |
11 | 18 | permissions: read-all |
12 | 19 |
|
13 | 20 | jobs: |
14 | 21 | analysis: |
15 | | - name: Scorecards analysis |
| 22 | + name: Scorecard analysis |
16 | 23 | runs-on: ubuntu-latest |
17 | 24 | permissions: |
18 | 25 | # Needed to upload the results to code-scanning dashboard. |
19 | 26 | security-events: write |
| 27 | + # Needed to publish results and get a badge (see publish_results below). |
| 28 | + id-token: write |
| 29 | + # Uncomment the permissions below if installing in a private repository. |
| 30 | + # contents: read |
| 31 | + # actions: read |
20 | 32 |
|
21 | 33 | steps: |
22 | 34 | - name: "Checkout code" |
23 | | - uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0 |
| 35 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
24 | 36 | with: |
25 | 37 | persist-credentials: false |
26 | 38 |
|
27 | 39 | - name: "Run analysis" |
28 | | - uses: ossf/scorecard-action@175f59783fa96e44dd6fa96619ab7bdacab56b5c # v0.0.1 |
| 40 | + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 |
29 | 41 | with: |
30 | 42 | results_file: results.sarif |
31 | 43 | results_format: sarif |
32 | | - # Read-only PAT token. To create it, |
33 | | - # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation. |
| 44 | + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: |
| 45 | + # - you want to enable the Branch-Protection check on a *public* repository, or |
| 46 | + # - you are installing Scorecard on a *private* repository |
| 47 | + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. |
34 | 48 | repo_token: ${{ secrets.SCORECARD_TOKEN }} |
35 | | - # Publish the results to enable scorecard badges. For more details, see |
36 | | - # https://github.com/ossf/scorecard-action#publishing-results. |
37 | | - # If you are installing the action on a private repo, set it to `publish_results: false` |
38 | | - # or comment out the following line. |
39 | | - publish_results: true |
40 | 49 |
|
41 | | - # Upload the results as artifacts (optional). |
| 50 | + # Public repositories: |
| 51 | + # - Publish results to OpenSSF REST API for easy access by consumers |
| 52 | + # - Allows the repository to include the Scorecard badge. |
| 53 | + # - See https://github.com/ossf/scorecard-action#publishing-results. |
| 54 | + # For private repositories: |
| 55 | + # - `publish_results` will always be set to `false`, regardless |
| 56 | + # of the value entered here. |
| 57 | + publish_results: false |
| 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. |
42 | 61 | - name: "Upload artifact" |
43 | | - uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1 |
| 62 | + uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 |
44 | 63 | with: |
45 | 64 | name: SARIF file |
46 | 65 | path: results.sarif |
47 | 66 | retention-days: 5 |
48 | 67 |
|
49 | | - # Upload the results to GitHub's code scanning dashboard. |
| 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 |
50 | 70 | - name: "Upload to code-scanning" |
51 | | - uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26 |
| 71 | + uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 |
52 | 72 | with: |
53 | 73 | sarif_file: results.sarif |
0 commit comments