Skip to content

Harden CI supply chain: SHA-pin actions, pin npm in publish, fix fork-PR labeling, add audit #46

Closed

Description

@TMHSDigital

Why it matters

The project wants to be "the safe one" and publishes with npm provenance, but its own release pipeline uses mutable references. A compromised tag on a third-party action, or a bad npm@latest, would run with id-token: write (OIDC publish rights) or contents: write.

Evidence

  • All actions are pinned by major tag (actions/checkout@v7, setup-node@v7, stale@v10, the Pages actions), including the cross-repo TMHSDigital/Developer-Tools-Directory/.github/actions/[email protected].
  • publish.yml runs npm install -g npm@latest inside the job that holds id-token: write.
  • label-sync.yml uses pull_request, so on fork PRs the token is read-only and gh pr edit --add-label fails. That makes the job red for outside contributors. gh label create --force also resets label colors and descriptions on every PR.
  • The lockfile carries npm audit advisories in transitive SDK dependencies (@hono/node-server, body-parser, fast-uri; all fixable with npm audit fix). They're HTTP-transport code paths that this stdio-only server doesn't load, so exposure is low, but the audit report is noisy.

Suggested approach

  • Pin actions by commit SHA with a version comment and let Dependabot keep the SHAs updated (it already watches github-actions).
  • Pin npm to a known version that supports trusted publishing (e.g. [email protected]).
  • Make label-sync fork-safe (pull_request_target with no checkout of PR code, or actions/labeler), and stop force-recreating labels.
  • Run npm audit fix and add npm audit --omit=dev --audit-level=high to CI. Consider OpenSSF Scorecard and a CodeQL workflow.

Done when

Every uses: is SHA-pinned, publish uses a pinned npm, label-sync passes on fork PRs, and npm audit --omit=dev is clean in CI.

Activity

  1. added
    dependencies
    ci
    priority: P3
    security-hardening
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cidependenciespriority: P3security-hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions