|
| 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 | + # To guarantee Maintained check is occasionally updated. See |
| 7 | + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained |
| 8 | + schedule: |
| 9 | + # Weekly on Saturdays. |
| 10 | + - cron: '30 1 * * 6' |
| 11 | + push: |
| 12 | + branches: [ "main" ] |
| 13 | + |
| 14 | +# Declare default permissions as read only. |
| 15 | +permissions: read-all |
| 16 | + |
| 17 | +jobs: |
| 18 | + analysis: |
| 19 | + name: Scorecard analysis |
| 20 | + runs-on: ubuntu-latest |
| 21 | + permissions: |
| 22 | + # Needed if using Code scanning alerts |
| 23 | + security-events: write |
| 24 | + # Needed for GitHub OIDC token if publish_results is true |
| 25 | + id-token: write |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: "Checkout code" |
| 29 | + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 |
| 30 | + with: |
| 31 | + persist-credentials: false |
| 32 | + |
| 33 | + - name: "Run analysis" |
| 34 | + uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3 |
| 35 | + with: |
| 36 | + results_file: results.sarif |
| 37 | + results_format: sarif |
| 38 | + # Public repositories: |
| 39 | + # - Publish results to OpenSSF REST API for easy access by consumers |
| 40 | + # - Allows the repository to include the Scorecard badge. |
| 41 | + # - See https://github.com/ossf/scorecard-action#publishing-results. |
| 42 | + publish_results: true |
| 43 | + |
| 44 | + # Upload the results as artifacts. |
| 45 | + - name: "Upload artifact" |
| 46 | + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 |
| 47 | + with: |
| 48 | + name: SARIF file |
| 49 | + path: results.sarif |
| 50 | + retention-days: 5 |
| 51 | + |
| 52 | + # required for Code scanning alerts |
| 53 | + - name: "Upload SARIF results to code scanning" |
| 54 | + uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6 |
| 55 | + with: |
| 56 | + sarif_file: results.sarif |
0 commit comments