scorecards.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. jobs:
  10. analysis:
  11. name: Scorecards analysis
  12. runs-on: ubuntu-latest
  13. permissions:
  14. # Needed to upload the results to code-scanning dashboard.
  15. security-events: write
  16. # Used to receive a badge.
  17. id-token: write
  18. # read permissions to all the other objects
  19. actions: read
  20. attestations: read
  21. checks: read
  22. contents: read
  23. deployments: read
  24. issues: read
  25. discussions: read
  26. packages: read
  27. pages: read
  28. pull-requests: read
  29. statuses: read
  30. steps:
  31. - name: "Checkout code"
  32. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
  33. with:
  34. persist-credentials: false
  35. - name: "Run analysis"
  36. uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
  37. with:
  38. results_file: results.sarif
  39. results_format: sarif
  40. # Publish the results for public repositories to enable scorecard badges. For more details, see
  41. # https://github.com/ossf/scorecard-action#publishing-results.
  42. # For private repositories, `publish_results` will automatically be set to `false`, regardless
  43. # of the value entered here.
  44. publish_results: true
  45. # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
  46. # format to the repository Actions tab.
  47. - name: "Upload artifact"
  48. uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
  49. with:
  50. name: SARIF file
  51. path: results.sarif
  52. retention-days: 5
  53. # Upload the results to GitHub's code scanning dashboard.
  54. - name: "Upload to code-scanning"
  55. uses: github/codeql-action/upload-sarif@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2
  56. with:
  57. sarif_file: results.sarif