scorecards.yml 2.3 KB

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