Skip to content

CI hardening: SHA-pin actions, pin npm in the provenance job, scope permissions, fix label-sync, add CodeQL #191

Closed

Description

@TMHSDigital

Why it matters

The package is published with npm provenance (id-token: write), so the workflows that hold that token are the project's supply chain. Today they rely on mutable references. One workflow is also leftover template code that fails on fork PRs. None of this is an active exploit; it is standard hardening.

Evidence

  1. Actions are pinned by mutable tag: actions/checkout@v7, actions/setup-node@v6, actions/stale@v10, and the drift check TMHSDigital/Developer-Tools-Directory/[email protected].
  2. publish.yml:31 runs npm install -g npm@latest in the job that holds id-token: write.
  3. release.yml grants contents: write and actions: write at workflow level instead of per job.
  4. label-sync.yml is template leftovers.
    • It labels skills/ and rules/ paths that don't exist, and nothing labels src/.
    • It runs on pull_request, so fork PRs get a read-only token and the labeling step fails.
    • It checks out code it never uses.
  5. No code scanning. There is no CodeQL or OpenSSF Scorecard workflow.

Suggested approach

  • SHA-pin all third-party actions with a version comment. Dependabot's github-actions ecosystem is already configured and keeps them current.
  • Pin npm to a major (for example npm@11).
  • Move permissions to the jobs that need them.
  • Replace label-sync with actions/labeler (paths for src/tools, src/utils, docs, .github) or delete it.
  • Add CodeQL (javascript-typescript) and, optionally, the Scorecard action with a README badge.

Done when

  • No uses: reference is a mutable tag.
  • Fork PRs pass all required checks.
  • CodeQL runs on PRs.

Activity

  1. added
    security
    effort: small
    impact: medium
    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

    cieffort: smallimpact: mediumpriority: mediumsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions