scorecards.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # This workflow uses actions that are not certified by GitHub. They are provided
  2. # by a third-party and are governed by separate terms of service, privacy
  3. # policy, and support documentation.
  4. name: Scorecard supply-chain security
  5. on:
  6. # For Branch-Protection check. Only the default branch is supported. See
  7. # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
  8. branch_protection_rule:
  9. # To guarantee Maintained check is occasionally updated. See
  10. # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
  11. schedule:
  12. - cron: '20 7 * * 2'
  13. push:
  14. branches: ["master"]
  15. # Declare default permissions as read only.
  16. permissions: read-all
  17. jobs:
  18. analysis:
  19. name: Scorecard analysis
  20. runs-on: ubuntu-latest
  21. permissions:
  22. # Needed to upload the results to code-scanning dashboard.
  23. security-events: write
  24. # Needed to publish results and get a badge (see publish_results below).
  25. id-token: write
  26. contents: read
  27. actions: read
  28. # To allow GraphQL ListCommits to work
  29. issues: read
  30. pull-requests: read
  31. # To detect SAST tools
  32. checks: read
  33. steps:
  34. - name: Harden Runner
  35. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  36. with:
  37. egress-policy: audit
  38. - name: "Checkout code"
  39. uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  40. with:
  41. persist-credentials: false
  42. - name: "Run analysis"
  43. uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
  44. with:
  45. results_file: results.sarif
  46. results_format: sarif
  47. # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
  48. # - you want to enable the Branch-Protection check on a *public* repository, or
  49. # - you are installing Scorecards on a *private* repository
  50. # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
  51. # repo_token: ${{ secrets.SCORECARD_TOKEN }}
  52. # Public repositories:
  53. # - Publish results to OpenSSF REST API for easy access by consumers
  54. # - Allows the repository to include the Scorecard badge.
  55. # - See https://github.com/ossf/scorecard-action#publishing-results.
  56. # For private repositories:
  57. # - `publish_results` will always be set to `false`, regardless
  58. # of the value entered here.
  59. publish_results: true
  60. # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
  61. # format to the repository Actions tab.
  62. - name: "Upload artifact"
  63. uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
  64. with:
  65. name: SARIF file
  66. path: results.sarif
  67. retention-days: 5
  68. # Upload the results to GitHub's code scanning dashboard.
  69. - name: "Upload to code-scanning"
  70. uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
  71. with:
  72. sarif_file: results.sarif