---
title: "Which commit and workflow published this npm package version? | Proofline"
description: "A version published with provenance has an attestation that names the source repository, workflow, ref, commit and CI run."
url: https://proofline.sh/learn/npm-package-provenance-commit/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# Which commit and workflow published this npm package version?

A version published with provenance has an attestation that names the source repository, workflow, ref, commit and CI run. Its subject digest matches the tarball you install. Read those fields from the registry. npm audit signatures verifies the attestations that exist but exits 0 when a package has none, so count them. Provenance does not show that the commit was reviewed or that its tests passed.

Broken dependencies The Proofline team December 2, 2026 3 min read

## Read the attestation

npm's documentation lists what the package page shows for a version with provenance: the build environment, a build summary linking the workflow run, the source commit, the build file and a public ledger entry. [Viewing package provenance](https://docs.npmjs.com/viewing-package-provenance) The same data is in the registry. This fixture reads it for `semver@7.8.6` (npm 11.19.1, Node.js 24.22.3):

```
$ npm view semver@7.8.6 dist.attestations --json
{
  "url": "https://registry.npmjs.org/-/npm/v1/attestations/semver@7.8.6",
  "provenance": {
    "predicateType": "https://slsa.dev/provenance/v1"
  }
}
```

Decoding the SLSA provenance statement at that URL and selecting fields with `jq` gives the following. `workflow` is `predicate.buildDefinition.externalParameters.workflow`, `resolvedDependencies` sits under `predicate.buildDefinition`, and the fixture's `builder` and `invocationId` are `predicate.runDetails.builder.id` and `predicate.runDetails.metadata.invocationId`.

```
[…]
  "workflow": {
    "ref": "refs/heads/main",
    "repository": "https://github.com/npm/node-semver",
    "path": ".github/workflows/release.yml"
  },
  "resolvedDependencies": [
    {
      "uri": "git+https://github.com/npm/node-semver@refs/heads/main",
      "digest": {
        "gitCommit": "b37b033b585ad5e575afeccadb426ea41bc6cea4"
      }
    }
  ],
  "builder": "https://github.com/actions/runner/github-hosted",
  "invocationId": "https://github.com/npm/node-semver/actions/runs/41486847600/attempts/1"
[…]
```

The statement's subject is `pkg:npm/semver@7.8.6` with a SHA-512 digest. Converted to base64, it equals the version's `dist.integrity`, `sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==`, so the attestation describes the tarball npm installs. The commit equals the one the repository's `v7.8.6` tag names: `gh api repos/npm/node-semver/commits/v7.8.6 --jq .sha` returned `b37b033b585ad5e575afeccadb426ea41bc6cea4`.

## Count what npm audit signatures verified

The command verifies registry signatures and, where present, provenance attestations. [npm audit, Audit Signatures](https://docs.npmjs.com/cli/v11/commands/npm-audit#audit-signatures) With `semver@7.8.6` and `ms@2.1.3`, which has no provenance, it reported:

```
audited 2 packages in 1s

2 packages have verified registry signatures

1 package has a verified attestation
(use --json --include-attestations to view attestation details)

exit 0
```

The missing attestation is visible only as the difference between 2 and 1. A pipeline that relies on the exit status cannot tell a package without provenance from one with it.

## What it does not establish

npm states that provenance does not show that a package is free of malicious code. It links the package to its source and build instructions, which you can then audit. [Generating provenance statements](https://docs.npmjs.com/generating-provenance-statements)

| Question | Answered by provenance? |
| --- | --- |
| Which repository, workflow file, ref and commit built this tarball | Yes |
| Which run published it | Yes, `runDetails.metadata.invocationId` |
| Whether tests passed on that commit | No. Read the commit's checks or the run's other jobs |
| Whether the workflow is the one you expect | Only if you compare `path` with the expected file |
| Whether the package's dependencies have provenance | No. Each version has its own attestation, or none |

Publishers add provenance with `npm publish --provenance` from a supported cloud CI provider. With trusted publishing, npm generates it automatically. [Generating provenance statements](https://docs.npmjs.com/generating-provenance-statements) · [Trusted publishing](https://docs.npmjs.com/trusted-publishers)

## Worked example

This example is fictional. After an incident, Dara needs to know which commit produced version 4.2.1 of an internal package. The attestation names `release.yml` on `main` and commit `c7e0…`. The package's `v4.2.1` tag points to `a91d…`, the commit the team tested. The workflow had been dispatched from `main` an hour after the tag, so it published a later commit under the tested version number. Dara reports the commit from the attestation, not the tag, as the code that ran.

For the same check on other artifacts, read [build provenance attestations](/learn/verify-build-provenance-attestation/). For how CI installs dependencies, read [npm install versus the lockfile in CI](/learn/npm-install-lockfile-in-ci/).

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [What does a build provenance attestation prove about an artifact?](/learn/verify-build-provenance-attestation/)
    
    Deployment failures The Proofline team December 2, 2026 3 min read
    
-   ### [CI ran npm install, so it tested a lockfile nobody committed](/learn/npm-install-lockfile-in-ci/)
    
    Broken dependencies The Proofline team December 2, 2026 3 min read
