scorecard.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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: '43 14 * * 5'
  13. push:
  14. branches: [ "main" ]
  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. # Uncomment the permissions below if installing in a private repository.
  27. # contents: read
  28. # actions: read
  29. steps:
  30. - name: "Checkout code"
  31. uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
  32. with:
  33. persist-credentials: false
  34. - name: "Run analysis"
  35. uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
  36. with:
  37. results_file: results.sarif
  38. results_format: sarif
  39. # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
  40. # - you want to enable the Branch-Protection check on a *public* repository, or
  41. # - you are installing Scorecard on a *private* repository
  42. # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
  43. # repo_token: ${{ secrets.SCORECARD_TOKEN }}
  44. # Public repositories:
  45. # - Publish results to OpenSSF REST API for easy access by consumers
  46. # - Allows the repository to include the Scorecard badge.
  47. # - See https://github.com/ossf/scorecard-action#publishing-results.
  48. # For private repositories:
  49. # - `publish_results` will always be set to `false`, regardless
  50. # of the value entered here.
  51. publish_results: true
  52. # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
  53. # format to the repository Actions tab.
  54. - name: "Upload artifact"
  55. uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
  56. with:
  57. name: SARIF file
  58. path: results.sarif
  59. retention-days: 5
  60. # Upload the results to GitHub's code scanning dashboard.
  61. - name: "Upload to code-scanning"
  62. uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
  63. with:
  64. sarif_file: results.sarif