|
| 1 | +name: Scorecards supply-chain security |
| 2 | +on: |
| 3 | + # Only the default branch is supported. |
| 4 | + branch_protection_rule: |
| 5 | + schedule: |
| 6 | + - cron: '42 15 * * 3' |
| 7 | + push: |
| 8 | + branches: [ "dev" ] |
| 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 | + # Used to receive a badge. (Upcoming feature) |
| 21 | + id-token: write |
| 22 | + # Needs for private repositories. |
| 23 | + contents: read |
| 24 | + actions: read |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: "Checkout code" |
| 28 | + uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 |
| 29 | + with: |
| 30 | + persist-credentials: false |
| 31 | + |
| 32 | + - name: "Run analysis" |
| 33 | + uses: ossf/scorecard-action@3e15ea8318eee9b333819ec77a36aca8d39df13e # v1.1.1 |
| 34 | + with: |
| 35 | + results_file: results.sarif |
| 36 | + results_format: sarif |
| 37 | + # (Optional) Read-only PAT token. Uncomment the `repo_token` line below if: |
| 38 | + # - you want to enable the Branch-Protection check on a *public* repository, or |
| 39 | + # - you are installing Scorecards on a *private* repository |
| 40 | + repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} |
| 41 | + |
| 42 | + # Publish the results for public repositories to enable scorecard badges. For more details, see |
| 43 | + # https://github.com/ossf/scorecard-action#publishing-results. |
| 44 | + # For private repositories, `publish_results` will automatically be set to `false`, regardless |
| 45 | + # of the value entered here. |
| 46 | + publish_results: true |
| 47 | + |
| 48 | + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF |
| 49 | + # format to the repository Actions tab. |
| 50 | + - name: "Upload artifact" |
| 51 | + uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0 |
| 52 | + with: |
| 53 | + name: SARIF file |
| 54 | + path: results.sarif |
| 55 | + retention-days: 5 |
| 56 | + |
| 57 | + # Upload the results to GitHub's code scanning dashboard. |
| 58 | + - name: "Upload to code-scanning" |
| 59 | + uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26 |
| 60 | + with: |
| 61 | + sarif_file: results.sarif |
0 commit comments