|
| 1 | +name: Scorecards supply-chain security |
| 2 | +on: |
| 3 | + # Only the default branch is supported. |
| 4 | + branch_protection_rule: |
| 5 | + schedule: |
| 6 | + - cron: '34 9 * * 5' |
| 7 | + push: |
| 8 | + branches: ["master"] |
| 9 | + |
| 10 | +# Declare default permissions as read only. |
| 11 | +permissions: read-all |
| 12 | + |
| 13 | +jobs: |
| 14 | + analysis: |
| 15 | + name: Scorecards analysis |
| 16 | + runs-on: ubuntu-latest |
| 17 | + permissions: |
| 18 | + # Needed to upload the results to code-scanning dashboard. |
| 19 | + security-events: write |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: "Checkout code" |
| 23 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 24 | + with: |
| 25 | + persist-credentials: false |
| 26 | + |
| 27 | + - name: "Run analysis" |
| 28 | + uses: ossf/scorecard-action@08f935069d990d2675a557ebcecc774477e7c55c # v2.4.0+deps |
| 29 | + with: |
| 30 | + results_file: results.sarif |
| 31 | + 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. |
| 34 | + 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 | + |
| 41 | + # Upload the results as artifacts (optional). |
| 42 | + - name: "Upload artifact" |
| 43 | + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 |
| 44 | + with: |
| 45 | + name: SARIF file |
| 46 | + path: results.sarif |
| 47 | + retention-days: 5 |
| 48 | + |
| 49 | + # Upload the results to GitHub's code scanning dashboard. |
| 50 | + - name: "Upload to code-scanning" |
| 51 | + uses: github/codeql-action/upload-sarif@86b04fb0e47484f7282357688f21d5d0e32175fe # v3.27.0 |
| 52 | + with: |
| 53 | + sarif_file: results.sarif |
0 commit comments