scorecards.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Scorecards supply-chain security
  2. on:
  3. # Only the default branch is supported.
  4. branch_protection_rule:
  5. schedule:
  6. - cron: '44 9 * * 4'
  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.
  19. id-token: write
  20. steps:
  21. - name: "Checkout code"
  22. uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
  23. with:
  24. persist-credentials: false
  25. - name: "Run analysis"
  26. uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # tag=v2.0.6
  27. with:
  28. results_file: results.sarif
  29. results_format: sarif
  30. # Publish the results for public repositories to enable scorecard badges. For more details, see
  31. # https://github.com/ossf/scorecard-action#publishing-results.
  32. # For private repositories, `publish_results` will automatically be set to `false`, regardless
  33. # of the value entered here.
  34. publish_results: true
  35. # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
  36. # format to the repository Actions tab.
  37. - name: "Upload artifact"
  38. uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # tag=v3.0.0
  39. with:
  40. name: SARIF file
  41. path: results.sarif
  42. retention-days: 5
  43. # Upload the results to GitHub's code scanning dashboard.
  44. - name: "Upload to code-scanning"
  45. uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # tag=v1.0.26
  46. with:
  47. sarif_file: results.sarif