← Back to Pull requests

:seedling: Replace `rhysd/actionlint` with a Scorecard-owned workflow model #5287

Closed
unknown closed this pull request without merging on Oct 05, 2026 21:31 UTC
View on GitHub
unknown unknown commented on Oct 04, 2026 08:02 UTC
Author

What kind of change does this PR introduce?

Dependency replacement and internal refactor.

  • PR title follows the guidelines defined in our pull request documentation
  • What is the current behavior?

    Scorecard depends on github.com/rhysd/actionlint v1.7.9, which is unmaintained. Scorecard only uses its workflow parser and AST. v1.7.9 doesn't build against go.yaml.in/yaml/v4 past rc.3, which blocks dependency updates such as #5264.

    What is the new behavior (if this is a feature change)?

  • Commit 1: adds internal/ghworkflow, a Scorecard-owned workflow model. The backend parser is imported only in convert.go, so it can be replaced without touching checks or probes. Tests pin the parser behaviour Scorecard relies on, independent of the backend.

  • Commit 2: moves all checks, probes and checks/fileparser helpers onto the new model. The backend is still rhysd here, so results are unchanged.

  • Commit 3: switches the backend to actionlint.kjanat.dev v1.17.0, the only maintained fork, and moves yaml/v4 to rc.6.
  • Tests for the changes have been added (for bug fixes/features)
  • Which issue(s) this PR fixes

    Fixes #5278

    Special notes for your reviewer

    Each commit builds and passes tests on its own, so reviewing commit by commit is easiest.

    Behaviour differences found when switching to kjanat (commit 3):

  • runs-on: ${{ matrix.os }}. kjanat reports this in a new Runner.Expression field instead of LabelsExpr. Without handling it, Scorecard silently loses OS and shell detection for matrix jobs. Four existing tests caught this, and so did the new compatibility test. convert.go maps the field back.

  • YAML aliases now resolve (an upstream change since v1.7.10). The anchor fixture's alias points at the same unpinned action, so Pinned-Dependencies reports 2 findings instead of 1. This changes scores for repositories that reuse unpinned actions through aliases; #5291 is open to discuss that. kjanat reports every use of an anchor at the anchor's line, so both findings point at line 24, where the action is written.

  • Exported checks/fileparser helpers (GetJobName, AnyJobsMatch, IsPackagingWorkflow and others) now take internal/ghworkflow types instead of rhysd/actionlint types. Any parser change alters these signatures. A GitHub code search found no callers outside Scorecard and its forks.

  • Error wording. Some parse error messages are worded differently. The script-injection patch validator only compares errors from the same parser, so it is unaffected.
  • kjanat governance. It has a single maintainer whose PRs are reviewed only by bots, its module path is on a personal domain, and it changes quickly. Release tags are signed and releases carry build provenance. The adapter keeps a future backend swap, for example to an in-tree parser, local to one file. Every version bump should still go through the internal/ghworkflow compatibility tests.

    Dependency footprint. After go mod tidy, the only new module is clipperhouse/uax29/v2. The rest of the go.mod diff is minor version bumps.

    Verification

  • Unit tests (SKIP_GINKGO=1 go test -race) pass on every package. check-linter passes in CI with the pinned golangci-lint.

  • Before/after scans. I built scorecard from the merge base and from this branch and ran Dangerous-Workflow, Pinned-Dependencies, Token-Permissions, Binary-Artifacts, SAST and Packaging on eight repositories: ossf/scorecard, sigstore/cosign, step-security/harden-runner, tektoncd/pipeline, home-assistant/core, nodejs/node, python/cpython and kubernetes/kubernetes. Scores, reasons and details matched main on all eight.

  • - home-assistant/core's Packaging finding can point at a different line from run to run, on main too: AnyJobsMatch returns the first matching job while iterating over a map, and that workflow has two publishing jobs.
  • Repositories that use aliases. Pinned-Dependencies on cloudflare/ebpf_exporter goes from 28 to 44 unpinned-action warnings, and on pylint-dev/astroid from 32 to 45. The new warnings are alias uses, reported on the same lines as their anchors. Both scores are 0 before and after.
  • Does this PR introduce a user-facing change?

    ``release-note
    Workflow checks now resolve YAML aliases in GitHub Actions workflows. Values reached through an alias, such as an aliased
    uses: or run:, were previously skipped and are now checked, for example by Pinned-Dependencies and Dangerous-Workflow.
    ``

    Diff: 575 lines (+431 / -144) across 7 files Reviewer: justaugustus Review duration: 2248m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 575 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.380
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5287"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.8% (MEDIUM) · Higher = larger blast radius
    49.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.7% · Safe to merge
    19.7%
    Repository