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 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@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.1.0
  23. with:
  24. persist-credentials: false
  25. - name: "Run analysis"
  26. uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # tag=v2.1.2
  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@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3.1.2
  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@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # tag=v2.1.27
  46. with:
  47. sarif_file: results.sarif