scorecards-analysis.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Scorecards supply-chain security
  2. on:
  3. # Only the default branch is supported.
  4. branch_protection_rule:
  5. schedule:
  6. - cron: '28 22 * * 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@v3.1.0
  23. with:
  24. persist-credentials: false
  25. - name: "Run analysis"
  26. uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # 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@83fd05a356d7e2593de66fc9913b3002723633cb # 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@v2 # v1.0.26
  48. with:
  49. sarif_file: results.sarif