security_badge.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # NOTE: Best to keep all of these remarks in, they might prove useful in the future.
  2. # This is basically just the standard one that is suggested on 'new workflow'.
  3. name: Scorecard supply-chain security
  4. on:
  5. # For Branch-Protection check. Only the default branch is supported. See
  6. # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
  7. branch_protection_rule:
  8. # To guarantee Maintained check is occasionally updated. See
  9. # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
  10. schedule:
  11. - cron: '25 2 * * 5'
  12. push:
  13. branches: [ "main" ]
  14. # Declare default permissions as read only.
  15. permissions: read-all
  16. jobs:
  17. analysis:
  18. name: Scorecard analysis
  19. runs-on: ubuntu-latest
  20. permissions:
  21. # Needed for Code scanning upload
  22. security-events: write
  23. # Needed for GitHub OIDC token if publish_results is true
  24. id-token: write
  25. steps:
  26. - name: "Checkout code"
  27. uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
  28. with:
  29. persist-credentials: false
  30. - name: "Run analysis"
  31. uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
  32. with:
  33. results_file: results.sarif
  34. results_format: sarif
  35. # Scorecard team runs a weekly scan of public GitHub repos,
  36. # see https://github.com/ossf/scorecard#public-data.
  37. # Setting `publish_results: true` helps us scale by leveraging your workflow to
  38. # extract the results instead of relying on our own infrastructure to run scans.
  39. # And it's free for you!
  40. publish_results: true
  41. # Upload the results as artifacts (optional). Commenting out will disable
  42. # uploads of run results in SARIF format to the repository Actions tab.
  43. # https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
  44. - name: "Upload artifact"
  45. uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
  46. with:
  47. name: SARIF file
  48. path: results.sarif
  49. retention-days: 5
  50. # Upload the results to GitHub's code scanning dashboard (optional).
  51. # Commenting out will disable upload of results to your repo's Code Scanning dashboard
  52. - name: "Upload to code-scanning"
  53. uses: github/codeql-action/upload-sarif@83a02f7883b12e0e4e1a146174f5e2292a01e601 # v2.16.4
  54. with:
  55. sarif_file: results.sarif