Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Use npm trusted publishing to add verifiable provenance to a package released by GitHub Actions. Configure the package for the exact GitHub owner, repository, workflow file, and optional environment; give the publishing job id-token: write; run on a GitHub-hosted runner with a current npm and Node.js; then run npm publish. For an eligible public package published from a public repository, npm creates the provenance attestation automatically. You do not need a long-lived npm write token or a --provenance flag on this path.

Provenance lets consumers verify which source repository and build workflow produced a published version. It does not prove that the package is safe, well maintained, or free of malicious code.

What npm provenance proves

An npm provenance attestation connects a published package version with the source commit and build context that produced it. A consumer can inspect the package’s provenance information and follow the relationship between the registry artifact, your repository, and the GitHub Actions run.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is an origin and build-integrity signal. It is not a malware scan, a security review, a quality certification, or a guarantee that the source itself is benign. Reviewers still need to inspect the code, dependencies, release process, and permissions.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

The most integrated way to create this evidence from GitHub Actions is npm trusted publishing. GitHub issues an OpenID Connect (OIDC) identity token to the workflow, and npm checks that identity against the publisher relationship configured for the package.

Choose trusted publishing or manual provenance

Characteristic npm trusted publishing Manual provenance workflow
Publishing credential OIDC identity from GitHub Actions; no long-lived npm write token in the release job Usually token-authenticated publishing plus an OIDC token for the attestation
Attestation setup Automatic for eligible GitHub Actions publications Explicitly invoke npm publish --provenance
Visibility requirement for automatic GitHub attestations Public package in a public repository Follow npm’s current provenance guidance for the package visibility and CI environment
Runner GitHub-hosted runner; self-hosted runners are not currently supported A supported hosted CI provider and environment
Write token in publish job Not required for publishing through the trusted relationship Commonly remains required for registry authentication

Prefer trusted publishing when your package and repository meet its requirements. Use the manual route only when the package’s release design or hosting environment is not covered by the trusted-publisher flow, and verify the current npm instructions before combining authentication and provenance flags.

Requirements and eligibility

  • The package must already be available to the maintainer account or organization so its settings can be changed.
  • The repository.url value in package.json must exactly identify the GitHub repository that publishes the package.
  • The npm package must have a trusted publisher configured for the exact GitHub owner or organization, repository, workflow filename, and, if used, environment.
  • The workflow must grant id-token: write to the publishing job or workflow.
  • The release must run on a GitHub-hosted runner. npm trusted publishing does not currently support self-hosted runners.
  • Use npm CLI 11.5.1 or newer and Node.js 22.14.0 or newer for trusted publishing.
  • Automatic provenance from this GitHub Actions feature applies when both the repository and package are public. A public package built in a private repository does not receive provenance through this feature.

A newly created trusted-publisher relationship must complete its first successful publish within two days. npm does not validate every field when you save the relationship, so treat the first publish as the real identity check. If the two-day window expires, delete the relationship, create it again, and complete a successful publish.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 1: make the package and repository identity match

Check package.json

Open the package’s package.json and inspect the repository field. Its URL must point to the same GitHub owner and repository that will run the publishing workflow. A mismatch in owner, repository name, spelling, or URL format can cause npm to reject the OIDC identity even when the code is in the expected repository.

{
  "name": "your-package",
  "version": "1.0.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/OWNER/REPOSITORY.git"
  }
}

Replace the example values with the actual owner and repository. Keep the repository metadata aligned when a project is transferred, renamed, or moved from a personal account to an organization. The trusted-publisher configuration and the package metadata must describe the same destination.

Confirm the package is under the account you will configure

Sign in to the npm account or organization that owns the package. You need package write permission to create or manage its trusted publisher. Do not configure a relationship on a similarly named package or under a different organization; npm evaluates the package receiving the publication.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Step 2: create the GitHub Actions trusted publisher in npm

  1. Open the package’s settings in npm and choose the trusted-publishing or trusted-publisher configuration.
  2. Add GitHub Actions as the publisher.
  3. Enter the GitHub user name or organization exactly as it appears in the repository owner field.
  4. Enter the repository name exactly, including capitalization.
  5. Enter the workflow filename only, including its .yml or .yaml extension. Do not enter the .github/workflows/ directory path.
  6. If the job uses a GitHub deployment environment, enter that environment name. If it does not, leave the environment setting unconfigured.
  7. Save the relationship and plan the first successful publication within two days.

The workflow file itself must live under .github/workflows/, but npm’s publisher field is only the filename. For example, a file at .github/workflows/publish.yml is entered as publish.yml. The comparison is exact and case-sensitive. Existing connections cannot be edited in place; if an owner, repository, filename, or environment is wrong, delete the connection and create a corrected one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 3: grant the workflow OIDC permission

GitHub Actions needs permission to mint the OIDC token that npm uses to authenticate the trusted publisher. Grant the narrowest permissions needed by the release workflow. A typical top-level configuration is:

permissions:
  id-token: write
  contents: read

You can place these permissions at workflow level or restrict them to the publish job. Keep unrelated permissions disabled unless another release step needs them. The id-token: write permission is the important addition; without it, the runner cannot present the identity npm expects.

Step 4: use a compatible GitHub Actions release workflow

The following shape follows npm’s current example. Review action versions and pin third-party actions to versions or commit SHAs that meet your repository’s security policy before using it verbatim.

name: Publish Package

on:
  push:
    tags:
      - 'v*'

permissions:
  id-token: write
  contents: read

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version: '24'
          registry-url: 'https://registry.npmjs.org'
          package-manager-cache: false
      - run: npm ci
      - run: npm run build --if-present
      - run: npm test
      - run: npm publish

Why each part matters

  • Tag trigger: Publishing only from a release tag keeps ordinary pushes from publishing accidental versions. Use the tag pattern that matches your release process.
  • runs-on: ubuntu-latest: The trusted-publishing feature currently requires a GitHub-hosted runner. Do not substitute a self-hosted runner for this path.
  • Node and npm versions: The setup action installs the selected Node.js release and its bundled npm. Ensure the resulting npm CLI is at least 11.5.1 and Node.js is at least 22.14.0. The example selects Node 24; verify current action and runtime support before changing it.
  • registry-url: This identifies the npm registry used by the setup step. It does not create a write credential.
  • package-manager-cache: false: npm’s release example disables package-manager caching. Keep or change this deliberately, considering reproducibility and your security policy.
  • npm ci: Install exactly what the lockfile specifies. If your package does not use a lockfile, use the installation command appropriate to its build.
  • Build and test: Produce the publishable files and run checks before the registry mutation. A failed test should stop the job before npm publish.
  • npm publish: With trusted publishing configured, npm obtains the OIDC identity and creates the provenance attestation automatically for an eligible publication. Do not add a long-lived write token or an explicit --provenance flag to this trusted-publishing flow without checking npm’s current guidance.

Step 5: publish and verify the attestation

  1. Commit the workflow and package metadata to the configured repository.
  2. Create the release tag that matches the workflow trigger, then push the tag.
  3. Open the GitHub Actions run and confirm checkout, dependency installation, build, tests, and publication all complete.
  4. Open the package’s provenance view on npm after the version appears. Confirm that it links to the expected repository, commit, and build details.
  5. If the source or workflow link is missing or points elsewhere, stop treating the release as verified and investigate the identity and eligibility checks below.

Provenance is generated during the trusted publication; there is no separate upload step. A package that appears in the registry without the expected attestation may be ineligible because the repository is private, the publisher identity did not match, the runner was unsupported, or the workflow did not receive the OIDC permission.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Manual provenance with npm publish --provenance

npm also documents an explicit provenance mode. In that design, the CI environment must provide an OIDC token, and the publishing process commonly authenticates to npm with a token. The command is:

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
npm publish --provenance

This route can be useful when you are following npm’s documented provenance workflow outside a configured GitHub trusted publisher. Check the current npm requirements for the hosted provider, package visibility, authentication method, and first publication. A first publication of a public package may require --access public.

Do not assume that adding --provenance to a trusted-publishing workflow improves the result. Trusted publishing already combines OIDC publication with automatic attestations. Mixing manual flags, token authentication, and trusted-publisher behavior can create confusing failures or leave an unnecessary write credential in the job.

Using the npm trust github command

The npm trust CLI can create the GitHub relationship from the command line, but its setup requirements differ from the minimum runtime needed to publish through an existing relationship. The command requires:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • npm CLI 11.15.0 or newer;
  • write permission for the package;
  • account-level two-factor authentication; and
  • an explicit permission such as --allow-publish or --allow-stage-publish.

Keep this distinction clear: trusted publishing generally requires npm 11.5.1 and Node 22.14.0 or newer, while the configuration command requires npm 11.15.0 or newer. If your local npm is older, update it before attempting the command, or configure the relationship in the package settings.

Staged publishing, environments, and release controls

Staged publishing

Staged publishing lets CI submit a version for maintainer review before it becomes generally available. Stage and direct-publish permissions are configured separately for the trusted publisher. If you choose this model, grant only the operation the workflow should perform and use the corresponding npm command, such as npm stage publish, where staged publishing is configured.

GitHub environments

A protected GitHub environment can add approval rules and deployment controls to the release job. If the publisher relationship includes an environment name, it must exactly match the environment used by the workflow. A missing, differently cased, or renamed environment changes the identity npm validates.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Additional hardening

  • Protect release tags so an unreviewed commit cannot trigger publication.
  • Use a protected environment for approval before a production release.
  • After trusted publishing works, restrict or remove unused npm write tokens.
  • Audit trusted-publisher configurations and delete connections for repositories or workflows that no longer publish the package.
  • Keep workflow permissions minimal and review changes to release actions.

Dist-tags

Updating tags such as latest is separate from permission to publish a package version. A trusted publisher must be explicitly enabled for dist-tag operations. npm documents newer CLI requirements for these operations, so verify the current CLI version before adding tag management to the release job.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Private dependencies need separate read access

OIDC trusted publishing authenticates the publication itself; it does not grant access to private dependencies. If npm ci or another installation step reads private packages, configure a separate read-only credential for dependency installation. Do not reuse a write credential for that purpose, and do not expose a publishing secret to build steps that only need to download dependencies.

Separate the phases

  1. Provide the minimum read-only credential required for dependency installation.
  2. Install and build the package.
  3. Run tests and packaging checks.
  4. Publish through the trusted OIDC relationship, without converting the read credential into a registry write credential.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot the first failed publish

ENEEDAUTH or an authentication failure

  • Confirm that the publishing job has id-token: write, not merely read permissions.
  • Check that the job runs on a GitHub-hosted runner.
  • Verify that the npm CLI is at least 11.5.1 and Node.js is at least 22.14.0.
  • Check the owner or organization, repository name, workflow filename, extension, capitalization, and optional environment in npm’s trusted-publisher record.
  • Enter only the workflow filename in npm; do not include .github/workflows/.
  • Confirm that the file actually exists under .github/workflows/ and that the triggering workflow is the one named in the relationship.
  • Compare repository.url in package.json with the repository that ran the job.
  • If a reusable workflow is involved, check which workflow’s caller identity npm validates. The configured relationship must correspond to the identity presented by the publishing invocation, not an assumed template location.
  • Check whether the new relationship’s two-day first-use window has expired. If it has, delete and recreate it.

npm does not validate all identity fields when you save the configuration. A saved relationship can therefore look correct while the first publication reveals a mismatch.

The package publishes but has no provenance

  • Check that the npm package is public and the source repository is public; a public package in a private repository is not eligible for automatic provenance through this feature.
  • Confirm that the publication used the trusted-publisher relationship rather than an older token-based job.
  • Verify that the runner was GitHub-hosted and that the OIDC permission was present on the job that executed npm publish.
  • Inspect the package’s provenance view after the registry has processed the version; an immediately published version may need a short processing interval.

The workflow identity changed

Renaming a repository, moving it to an organization, changing the workflow filename, or introducing an environment can invalidate the relationship. Existing connections cannot be edited in place. Delete the old connection, create one with the new exact identity, and complete a successful publish within two days.

Build or test failures before publication

These are not provenance failures. Check the lockfile, Node.js runtime, build output, test command, and package files included by npm. Keep the publish command last so an unsuccessful verification phase cannot create a release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operational checklist

  • Package ownership and write access are confirmed.
  • repository.url exactly matches the publishing GitHub repository.
  • The npm trusted publisher names the correct owner, repository, workflow filename, and environment.
  • The relationship’s first successful publication will occur within two days of creation.
  • The workflow runs on a GitHub-hosted runner.
  • Node.js is 22.14.0 or newer and npm is 11.5.1 or newer.
  • The publishing job has id-token: write and only the other permissions it needs.
  • Dependencies install, the package builds, and tests pass before npm publish.
  • Private dependencies use a separate read-only credential.
  • Release tags and environments are protected where appropriate.
  • The published version’s npm provenance view points to the intended source and build.

What consumers should do with provenance

Use the attestation to verify that the package came from the expected repository and release workflow, then continue your normal due diligence. Compare the linked commit with the project’s release tag, inspect dependency changes, review the workflow’s permissions, and consider whether the build is reproducible for your risk level. Provenance narrows the question of “where did this artifact come from?”; it does not answer “is this code safe for my application?”

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Frequently Asked Questions

Do I need an npm automation or write token when using GitHub Actions trusted publishing?

No. The trusted-publishing path uses GitHub’s OIDC identity and does not require a long-lived npm write token in the publishing job.

Can a self-hosted GitHub Actions runner create npm trusted-publishing provenance?

Not currently. npm trusted publishing supports GitHub-hosted runners; use the supported hosted environment or follow npm’s separate manual provenance guidance.

Why did my public package receive no provenance?

Automatic provenance requires both a public npm package and a public source repository, plus a matching trusted publisher, supported runner, current npm and Node.js versions, and id-token: write. A public package built from a private repository is not eligible through this feature.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I edit a trusted-publisher connection after changing the workflow filename?

No. Delete the existing connection and create a new one with the exact owner, repository, filename, and environment. Complete the first successful publish within two days.

The Bottom Line

For an eligible public package and public repository, configure npm trusted publishing, grant id-token: write, publish from a GitHub-hosted runner with npm 11.5.1+ and Node.js 22.14.0+, and verify the resulting provenance view. The attestation makes origin and build context auditable, not the package’s safety.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.