2
0

scorecard.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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: '27 12 * * 4'
  13. push:
  14. branches: [ "develop" ]
  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. # `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
  22. if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
  23. permissions:
  24. # Needed to upload the results to code-scanning dashboard.
  25. security-events: write
  26. # Needed to publish results and get a badge (see publish_results below).
  27. id-token: write
  28. # Uncomment the permissions below if installing in a private repository.
  29. # contents: read
  30. # actions: read
  31. steps:
  32. - name: "Checkout code"
  33. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  34. with:
  35. persist-credentials: false
  36. - name: "Run analysis"
  37. uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
  38. with:
  39. results_file: results.sarif
  40. results_format: sarif
  41. # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
  42. # - you want to enable the Branch-Protection check on a *public* repository, or
  43. # - you are installing Scorecard on a *private* repository
  44. # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
  45. # repo_token: ${{ secrets.SCORECARD_TOKEN }}
  46. # Public repositories:
  47. # - Publish results to OpenSSF REST API for easy access by consumers
  48. # - Allows the repository to include the Scorecard badge.
  49. # - See https://github.com/ossf/scorecard-action#publishing-results.
  50. # For private repositories:
  51. # - `publish_results` will always be set to `false`, regardless
  52. # of the value entered here.
  53. publish_results: true
  54. # (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
  55. # file_mode: git
  56. # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
  57. # format to the repository Actions tab.
  58. - name: "Upload artifact"
  59. uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
  60. with:
  61. name: SARIF file
  62. path: results.sarif
  63. retention-days: 5
  64. # Upload the results to GitHub's code scanning dashboard (optional).
  65. # Commenting out will disable upload of results to your repo's Code Scanning dashboard
  66. - name: "Upload to code-scanning"
  67. uses: github/codeql-action/upload-sarif@v4
  68. with:
  69. sarif_file: results.sarif