ossf-scorecard.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: OSSF Scorecard
  2. on:
  3. push:
  4. branches:
  5. - main
  6. schedule:
  7. - cron: "56 23 * * 6" # once a week
  8. workflow_dispatch:
  9. permissions: read-all
  10. jobs:
  11. analysis:
  12. runs-on: ubuntu-latest
  13. permissions:
  14. # Needed for Code scanning upload
  15. security-events: write
  16. # Needed for GitHub OIDC token if publish_results is true
  17. id-token: write
  18. steps:
  19. - name: Harden the runner (Audit all outbound calls)
  20. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  21. with:
  22. egress-policy: audit
  23. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  24. with:
  25. persist-credentials: false
  26. - uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
  27. with:
  28. results_file: results.sarif
  29. results_format: sarif
  30. publish_results: true
  31. # Upload the results as artifacts (optional). Commenting out will disable
  32. # uploads of run results in SARIF format to the repository Actions tab.
  33. # https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
  34. - name: "Upload artifact"
  35. uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
  36. with:
  37. name: SARIF file
  38. path: results.sarif
  39. retention-days: 5
  40. # Upload the results to GitHub's code scanning dashboard (optional).
  41. # Commenting out will disable upload of results to your repo's Code Scanning dashboard
  42. - name: "Upload to code-scanning"
  43. uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
  44. with:
  45. sarif_file: results.sarif