diff --git a/.github/workflows/scorecard_analysis.yml b/.github/workflows/scorecard_analysis.yml index 55dc167e..4611e908 100644 --- a/.github/workflows/scorecard_analysis.yml +++ b/.github/workflows/scorecard_analysis.yml @@ -1,19 +1,44 @@ -- name: OSSF Scorecard action - # You may pin to the exact commit or the version. - # uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a - uses: ossf/scorecard-action@v2.4.3 - with: - # OUTPUT: Path to file to store results - results_file: - # OUTPUT: format of the results [json, sarif] - results_format: - # INPUT: GitHub token with read access - repo_token: # optional, default is ${{ github.token }} - # INPUT: Publish results - publish_results: # optional - # INPUT: Method to fetch files from GitHub - file_mode: # optional, default is archive - # INPUT: Base URL for publishing results. Used for testing. - internal_publish_base_url: # optional, default is https://api.scorecard.dev - # INPUT: Default GitHub token. (Internal purpose only, not intended for developers to set. Used for pull requests configured with a PAT). - internal_default_token: # optional, default is ${{ github.token }} +name: Scorecard analysis + +on: + push: + branches: [main] + schedule: + # Weekly on Saturdays. + - cron: "30 1 * * 6" + +# Keep the default token read-only. The analysis job grants only the two +# write permissions needed to publish and upload its results. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + security-events: write + id-token: write + steps: + - name: Checkout code + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Run analysis + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + + - name: Upload artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + - name: Upload to code scanning + uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 + with: + sarif_file: results.sarif