scorecards-analysis.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: '31 8 * * 6'
  7. push:
  8. branches: [ master ]
  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. actions: read
  19. contents: read
  20. steps:
  21. - name: "Checkout code"
  22. uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
  23. with:
  24. persist-credentials: false
  25. - name: "Run analysis"
  26. uses: ossf/scorecard-action@e3e75cf2ffbf9364bbff86cdbdf52b23176fe492 # v1.0.1
  27. with:
  28. results_file: results.sarif
  29. results_format: sarif
  30. # Read-only PAT token. To create it,
  31. # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
  32. repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
  33. # Publish the results to enable scorecard badges. For more details, see
  34. # https://github.com/ossf/scorecard-action#publishing-results.
  35. # For private repositories, `publish_results` will automatically be set to `false`,
  36. # regardless of the value entered here.
  37. publish_results: true
  38. # Upload the results as artifacts (optional).
  39. - name: "Upload artifact"
  40. uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1
  41. with:
  42. name: SARIF file
  43. path: results.sarif
  44. retention-days: 5
  45. # Upload the results to GitHub's code scanning dashboard.
  46. - name: "Upload to code-scanning"
  47. uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26
  48. with:
  49. sarif_file: results.sarif