security_badge.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # NOTE: Best to keep all of these remarks in, they might prove useful in the future.
  2. # This is basically just the standard one that is sugested on 'new workflow'.
  3. name: Scorecard supply-chain security
  4. on:
  5. # For Branch-Protection check. Only the default branch is supported. See
  6. # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
  7. branch_protection_rule:
  8. # To guarantee Maintained check is occasionally updated. See
  9. # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
  10. schedule:
  11. - cron: '25 2 * * 5'
  12. push:
  13. branches: [ "main" ]
  14. # Declare default permissions as read only.
  15. permissions: read-all
  16. jobs:
  17. analysis:
  18. name: Scorecard analysis
  19. runs-on: ubuntu-latest
  20. permissions:
  21. # Needed to upload the results to code-scanning dashboard.
  22. security-events: write
  23. # Needed to publish results and get a badge (see publish_results below).
  24. id-token: write
  25. # Uncomment the permissions below if installing in a private repository.
  26. # contents: read
  27. # actions: read
  28. steps:
  29. - name: "Checkout code"
  30. uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
  31. with:
  32. persist-credentials: false
  33. - name: "Run analysis"
  34. uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
  35. with:
  36. results_file: results.sarif
  37. results_format: sarif
  38. # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
  39. # - you want to enable the Branch-Protection check on a *public* repository, or
  40. # - you are installing Scorecard on a *private* repository
  41. # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
  42. # repo_token: ${{ secrets.SCORECARD_TOKEN }}
  43. # Public repositories:
  44. # - Publish results to OpenSSF REST API for easy access by consumers
  45. # - Allows the repository to include the Scorecard badge.
  46. # - See https://github.com/ossf/scorecard-action#publishing-results.
  47. # For private repositories:
  48. # - `publish_results` will always be set to `false`, regardless
  49. # of the value entered here.
  50. publish_results: true
  51. # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
  52. # format to the repository Actions tab.
  53. - name: "Upload artifact"
  54. uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
  55. with:
  56. name: SARIF file
  57. path: results.sarif
  58. retention-days: 5
  59. # Upload the results to GitHub's code scanning dashboard.
  60. - name: "Upload to code-scanning"
  61. uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
  62. with:
  63. sarif_file: results.sarif