From 5ed0baa22756c2a684a970757cbc28fdfb70f12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=AE=E9=9B=A8?= <47820304+PeterGuy326@users.noreply.github.com> Date: Thu, 10 Sep 2026 23:12:01 +0800 Subject: [PATCH] ci: report required Scorecard analysis on pull requests main requires the `OpenSSF Scorecard` context, but bytefolk-scorecard.yml triggers only on push(main)/schedule/workflow_dispatch, so the required context never reports on any pull request. Every PR in this repository is therefore permanently BLOCKED regardless of approvals -- measured on #45, which is green on all four reporting contexts and still cannot merge. Add a separate PR-triggered local analysis. It grants contents:read only, contains no run: step, persists no checkout credentials, sets publish_results: false, and pins all three actions to the same commits bytefolk-scorecard.yml already uses. Repository-wide reporting and badge publication on main are unchanged. Mirrors bytefolk/roleweave's existing scorecard-pr.yml and bytefolk/digital-employee#263. --- .github/workflows/scorecard-pr.yml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/scorecard-pr.yml diff --git a/.github/workflows/scorecard-pr.yml b/.github/workflows/scorecard-pr.yml new file mode 100644 index 0000000..e401e67 --- /dev/null +++ b/.github/workflows/scorecard-pr.yml @@ -0,0 +1,38 @@ +name: Scorecard PR + +on: + pull_request: + branches: + - main + +# PRs use Scorecard's local-checkout mode. Repository-wide checks and badge / +# SARIF publication remain in bytefolk-scorecard.yml on the default branch. +# Do not use pull_request_target or give this job publication credentials. +permissions: + contents: read + +jobs: + scorecard: + name: OpenSSF Scorecard + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + - name: Check out PR merge commit + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Analyze PR checkout + uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4 + with: + results_file: results.sarif + results_format: sarif + publish_results: false + + - name: Upload PR Scorecard report + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: scorecard-pr-results + path: results.sarif + if-no-files-found: error + retention-days: 14