Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/scorecard-enforcer.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: PMPL-1.0-or-later
# SPDX-License-Identifier: MPL-2.0
# Prevention workflow - runs OpenSSF Scorecard and fails on low scores
name: OpenSSF Scorecard Enforcer

Expand All @@ -18,9 +18,19 @@
cancel-in-progress: true

permissions:
contents: read

Check warning on line 21 in .github/workflows/scorecard-enforcer.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Move this read permission from workflow level to job level.

See more on https://sonarcloud.io/project/issues?id=hyperpolymath_panll&issues=AZ554Uot47GWV_L6lTU0&open=AZ554Uot47GWV_L6lTU0&pullRequest=70

jobs:
# The OSSF Scorecard publish endpoint enforces a hard contract: the job that
# runs `ossf/scorecard-action` with `publish_results: true` must contain
# ONLY steps with `uses:` (no `run:` steps in the same job). If a `run:`
# step is present, the publish step fails with:
# "webapp: scorecard job must only have steps with uses"
# (49 estate repos hit this; see ROADMAP audit 2026-05-30.)
#
# Fix: split the threshold check into a downstream job that depends on
# `scorecard` and consumes the SARIF artifact. The `scorecard` job stays
# uses-only; `check-score` is the gating job that emits the error.
scorecard:
runs-on: ubuntu-latest
permissions:
Expand All @@ -43,9 +53,26 @@
with:
sarif_file: results.sarif

- name: Persist SARIF for downstream score-gate job
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: scorecard-results
path: results.sarif
retention-days: 1

check-score:
needs: scorecard
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Download SARIF from scorecard job
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v5.0.0
with:
name: scorecard-results

- name: Check minimum score
run: |
# Parse score from results
SCORE=$(jq -r '.runs[0].tool.driver.properties.score // 0' results.sarif 2>/dev/null || echo "0")

echo "OpenSSF Scorecard Score: $SCORE"
Expand Down
Loading