diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 000000000..0778a6576 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,39 @@ +name: Scorecard + +# No push trigger: the weekly run on main publishes the results, so rescanning +# after every merge only repeated it. +on: + branch_protection_rule: + schedule: + - cron: "35 6 * * 1" + workflow_dispatch: + +permissions: + contents: read + +jobs: + analysis: + name: Scorecard analysis + timeout-minutes: 15 + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write # Upload Scorecard results to code scanning. + id-token: write # Publish results for the public Scorecard badge. + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Run Scorecard + uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + + - name: Upload results to code scanning + uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0 + with: + sarif_file: results.sarif