scorecards.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Scorecards supply-chain security
  2. on:
  3. # Only the default branch is supported.
  4. branch_protection_rule:
  5. schedule:
  6. - cron: '44 17 * * 0'
  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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  23. with:
  24. persist-credentials: false
  25. # This is a pre-submit / pre-release.
  26. - name: "Run analysis"
  27. uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
  28. with:
  29. results_file: results.sarif
  30. results_format: sarif
  31. # Publish the results for public repositories to enable scorecard badges. For more details, see
  32. # https://github.com/ossf/scorecard-action#publishing-results.
  33. # For private repositories, `publish_results` will automatically be set to `false`, regardless
  34. # of the value entered here.
  35. publish_results: true
  36. # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
  37. # format to the repository Actions tab.
  38. - name: "Upload artifact"
  39. uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
  40. with:
  41. name: SARIF file
  42. path: results.sarif
  43. retention-days: 5
  44. # Upload the results to GitHub's code scanning dashboard.
  45. - name: "Upload to code-scanning"
  46. uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
  47. with:
  48. sarif_file: results.sarif