# Review the path from GitHub Actions to npm

[Read this guide on KeySigner](https://keysigner.io/integrations/guides/github-actions-and-npm/)

Separate the person who approves a release from the workflow that publishes it. Rehearse the handoff before changing a real package.

## Before you start

- Use a disposable npm package and a workflow on a GitHub-hosted runner with Node.js 22.14.0 or later and npm 11.5.1 or later.
- Have permission to edit the package’s trusted publisher and configure the repository environment. Required reviewers on Free, Pro and Team are available for public repositories.
- [Check GitHub Actions availability](https://keysigner.io/integrations/setup-requirements/#provider-availability-github-actions)
- [Check npm availability](https://keysigner.io/integrations/setup-requirements/#provider-availability-npm)

## Data and access

- **Shared or checked**. GitHub Actions passes a publishing identity to npm. npm matches the repository and workflow against its trusted publisher settings.
- **Check separately**. Check release approval in the workflow and check who can publish through any other configured credentials.

## Who does what

- **Repository maintainer**. Chooses the workflow and release environment, and starts a run for the intended revision.
- **Environment reviewer**. Approves or denies the GitHub environment deployment if required reviewers are available and configured.
- **Package administrator**. Configures the npm trusted publisher and can correct its repository, workflow or environment. Keep this access available during the test.
- **Publishing job**. Uses the workflow’s configured publishing identity. Check its output against the version npm received.

## 1. Confirm the publishing identity

Choose a disposable package. Use npm's trusted publishing guide to identify which repository, workflow and environment are allowed to publish it.

**Check.** The trusted publisher lists the test repository and workflow filename, plus the environment if one is configured.

## 2. Review the release approval

Check who can change the release workflow and whether your GitHub plan allows the environment approval you need. Confirm how an authorized reviewer approves or denies the run.

**Check.** The test run waits for review before entering the publishing job. Check who reviewed it in the workflow run.

## 3. Verify the published result

After a test release, compare the package version and commit with the intended release and inspect the package's provenance when available.

**Check.** The registry shows the intended version. If it displays provenance, open it and compare the listed source with the run you reviewed.

## Check your result

A KeySigner rule used by a human maintainer covers only the operations that actually require it. Keep the package's publishing trust configuration in place.

[Verify an approval and its result](https://keysigner.io/integrations/approval-history/)

[How to verify your setup](https://keysigner.io/integrations/verify-a-setup/)

## If you get stuck

### Publishing is denied

Compare the owner, repository, workflow filename and environment in npm’s trusted publisher settings with the workflow that ran. Confirm the publishing job can request an identity token.

## Tools in this guide

- [GitHub Actions](https://keysigner.io/integrations/github-actions/)
  - [Review deployment environments](https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage-environments)
- [npm](https://keysigner.io/integrations/npm/)
  - [Review trusted publishers](https://docs.npmjs.com/trusted-publishers/)

## Setup instructions

- [Troubleshoot a package release approval](https://keysigner.io/integrations/guides/troubleshoot-a-package-release-approval/)
- [Replace a retired npm classic token](https://keysigner.io/integrations/guides/replace-retired-developer-credentials/)
- [Check an approved package with Cosign](https://keysigner.io/integrations/guides/check-an-approved-package-with-cosign/)

[More guides for this task](https://keysigner.io/integrations/tasks/review-code-and-releases/)
