|
| 1 | +name: Scorecards supply-chain security |
| 2 | +on: |
| 3 | + # Only the default branch is supported. |
| 4 | + branch_protection_rule: |
| 5 | + schedule: |
| 6 | + - cron: '18 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@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0 |
| 24 | + with: |
| 25 | + persist-credentials: false |
| 26 | + |
| 27 | + - name: "Run analysis" |
| 28 | + uses: ossf/scorecard-action@175f59783fa96e44dd6fa96619ab7bdacab56b5c # v0.0.1 |
| 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@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1 |
| 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@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26 |
| 52 | + with: |
| 53 | + sarif_file: results.sarif |
0 commit comments