|
| 1 | +--- |
| 2 | +# This workflow uses actions that are not certified by GitHub. They are provided by a third-party and are governed by separate terms of service, privacy policy, and support documentation. |
| 3 | +name: OSSF Scorecard |
| 4 | +on: |
| 5 | + # For Branch-Protection check. Only the default branch is supported. See https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection. |
| 6 | + branch_protection_rule: |
| 7 | + # To guarantee Maintained check is occasionally updated. See https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained. |
| 8 | + schedule: |
| 9 | + - cron: "0 0 * * 1" |
| 10 | + push: |
| 11 | + branches: [main, master] |
| 12 | + workflow_dispatch: |
| 13 | +# Declare default permissions as read only. |
| 14 | +permissions: read-all |
| 15 | +jobs: |
| 16 | + analysis: |
| 17 | + name: Scorecard analysis |
| 18 | + runs-on: ubuntu-24.04 |
| 19 | + # Delete the conditional below if you are using the OSSF Scorecard on a private repository. |
| 20 | + if: ${{ github.event.repository.private == false }} |
| 21 | + permissions: |
| 22 | + # Needed if using Code Scanning alerts. |
| 23 | + security-events: write |
| 24 | + # Needed for GitHub OIDC token if publish_results is true. |
| 25 | + id-token: write |
| 26 | + # Uncomment the permissions below if you are using the OSSF Scorecard on a private repository. |
| 27 | + # contents: read |
| 28 | + # actions: read |
| 29 | + # issues: read # To allow GraphQL ListCommits to work |
| 30 | + # pull-requests: read # To allow GraphQL ListCommits to work |
| 31 | + # checks: read # To detect SAST tools |
| 32 | + steps: |
| 33 | + - name: Check out the codebase |
| 34 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 35 | + with: |
| 36 | + persist-credentials: false |
| 37 | + |
| 38 | + - name: Run analysis |
| 39 | + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 |
| 40 | + with: |
| 41 | + results_file: results.sarif |
| 42 | + results_format: sarif |
| 43 | + # (Optional) fine-grained personal access token. Uncomment the `repo_token` line below if you want to enable the Branch-Protection or Webhooks check on a *private* repository. |
| 44 | + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-fine-grained-pat-optional. |
| 45 | + # repo_token: ${{ secrets.SCORECARD_TOKEN }} |
| 46 | + |
| 47 | + # Publish the results for public repositories to enable scorecard badges. For more details, see https://github.com/ossf/scorecard-action#publishing-results. |
| 48 | + # For private repositories, `publish_results` will automatically be set to `false`, regardless of the value entered here. |
| 49 | + publish_results: true |
| 50 | + |
| 51 | + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF format to the repository Actions tab. |
| 52 | + - name: Upload artifact |
| 53 | + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 |
| 54 | + with: |
| 55 | + name: SARIF file |
| 56 | + path: results.sarif |
| 57 | + retention-days: 5 |
| 58 | + |
| 59 | + # Upload the results to GitHub's code scanning dashboard. |
| 60 | + - name: Upload SARIF results to code scanning |
| 61 | + uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 |
| 62 | + with: |
| 63 | + sarif_file: results.sarif |
0 commit comments