Skip to content

Conversation

@GarthDB
Copy link
Member

@GarthDB GarthDB commented Jan 22, 2026

Summary

Migrates the release workflow from deprecated long-lived NPM tokens to npm's new Trusted Publishing feature using OpenID Connect (OIDC). This resolves the authentication failures in recent releases and eliminates the need to manage NPM_TOKEN secrets.

Problem

Recent releases have been failing with authentication errors:

npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@adobe%2f...
npm notice Access token expired or revoked. Please try logging in again.

This affects multiple releases including:

Result: No packages were published to npm, and no GitHub releases were created.

Solution

NPM now recommends Trusted Publishing with OIDC over long-lived tokens. This approach:

More Secure: Short-lived, workflow-specific credentials that can't be extracted
Zero Maintenance: No token rotation or secret management needed
Industry Standard: Recommended by OpenSSF, used by PyPI, RubyGems, etc.
Automatic Provenance: Built-in supply chain security

Changes

  • Removed NPM_TOKEN environment variable (no longer needed)
  • Added clarifying comment about OIDC requirement
  • id-token: write permission already in place (required for OIDC)

Required Setup (One-Time Configuration)

⚠️ Important: A repository maintainer with npm publish access must configure trusted publishers on npmjs.com for each package before merging this PR.

Packages to Configure Now (8 packages)

Configure these packages that are already published to npm:

Package Current Version npm Access Page
@adobe/changeset-linter 1.0.1 https://www.npmjs.com/package/@adobe/changeset-linter/access
@adobe/optimized-diff 1.0.0 https://www.npmjs.com/package/@adobe/optimized-diff/access
@adobe/spectrum-component-api-schemas 6.0.0 https://www.npmjs.com/package/@adobe/spectrum-component-api-schemas/access
@adobe/spectrum-component-diff-generator 1.4.1 https://www.npmjs.com/package/@adobe/spectrum-component-diff-generator/access
@adobe/spectrum-design-data-mcp 1.0.13 https://www.npmjs.com/package/@adobe/spectrum-design-data-mcp/access
@adobe/spectrum-diff-core 1.1.1 https://www.npmjs.com/package/@adobe/spectrum-diff-core/access
@adobe/spectrum-tokens 14.1.0 https://www.npmjs.com/package/@adobe/spectrum-tokens/access
@adobe/token-diff-generator 2.5.3 https://www.npmjs.com/package/@adobe/token-diff-generator/access

Configure Later (1 package)

This package was versioned in PR #670 but never published due to the auth failure:

  • @adobe/design-system-registry (v1.1.0 queued) - Configure trusted publisher after first successful publish

Configuration for Each Package

For each package above:

  1. Go to the package's npm access page (links above)
  2. Scroll to "Trusted Publisher" section
  3. Click "GitHub Actions" button
  4. Fill in these fields:
    • Organization or user: adobe
    • Repository: spectrum-design-data
    • Workflow filename: release.yml
    • Environment name: (leave blank)
  5. Click "Add Publisher"

Quick Setup Helper

Run this script to open all 8 package access pages at once:

./tools/open-all-package-access-pages.sh

Optional: Enhanced Security

After configuring trusted publishers, you can further secure each package:

  1. Go to package SettingsPublishing access
  2. Select "Require two-factor authentication and disallow tokens"
  3. This prevents token-based publishing while keeping OIDC working

Verification

After setup, the next merge to main will trigger a release using OIDC authentication. You can verify success by:

  • Checking the workflow logs show successful npm publish
  • Confirming packages appear on npm with new versions
  • Verifying GitHub releases are created

Testing

This can be tested after trusted publishers are configured by:

  1. Merging a changeset to main
  2. Watching the release workflow use OIDC authentication
  3. Confirming packages publish successfully

References

Related

- Remove NPM_TOKEN secret dependency (now using OIDC)
- Add clarifying comment about trusted publishing requirement
- id-token: write permission already in place

This requires configuring trusted publishers on npmjs.com for:
- @adobe/spectrum-tokens
- @adobe/token-diff-generator
- @adobe/spectrum-design-data-mcp
- @adobe/design-system-registry
- token-csv-generator

Resolves authentication errors in release workflow.
See: https://docs.npmjs.com/trusted-publishers
@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

⚠️ No Changeset found

Latest commit: efc32ed

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@GarthDB
Copy link
Member Author

GarthDB commented Jan 22, 2026

Run report for efc32ed3

Total time: 6.5ms | Comparison time: 0s | Estimated loss: 6.5ms (100.0% slower)

Action Time Status Info
🟩 SyncWorkspace 6.4ms Passed
Touched files
.github/workflows/release.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants