Skip to content

Commit 5202835

Browse files
committed
fix: remove environment from canary publish job for trusted publishing
The GitHub environment name must match exactly between the workflow and npmjs.com trusted publisher config. Since we document leaving environment empty on npmjs.com, the workflow should not use an environment either.
1 parent c263cad commit 5202835

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/PUBLISHING.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,10 @@ Publishing logic has been moved to a dedicated `publish.yml` workflow file to su
7676

7777
## Manual Setup Steps
7878

79-
Complete these steps **before** merging the trusted publishing changes:
79+
> ⚠️ **CRITICAL**: Complete Step 1 **BEFORE** any workflow runs. The workflow will fail with `ENEEDAUTH` error if the trusted publisher is not configured first!
8080
8181
### Step 1: Configure Trusted Publisher on npmjs.com
8282

83-
> ⚠️ **Important**: This must be done BEFORE the first publish attempt with the new workflow.
84-
8583
1. Log in to [npmjs.com](https://www.npmjs.com) with an account that has publish access
8684
2. Go to: https://www.npmjs.com/package/@cube-dev/ui-kit/settings
8785
3. Scroll to the **"Trusted Publisher"** section
@@ -90,10 +88,10 @@ Complete these steps **before** merging the trusted publishing changes:
9088

9189
| Field | Value |
9290
|-------|-------|
93-
| Organization or user | `cube-js` |
91+
| Owner | `cube-js` |
9492
| Repository | `cube-ui-kit` |
9593
| Workflow filename | `publish.yml` |
96-
| Environment name | _(leave empty)_ |
94+
| Environment | _(leave empty)_ |
9795

9896
6. Click **Save** (or the equivalent button)
9997

@@ -160,6 +158,14 @@ Before merging the trusted publishing PR, verify:
160158

161159
## Troubleshooting
162160

161+
### `ENEEDAUTH` / "need auth" / "You need to authorize this machine" error
162+
163+
This is the most common error when first setting up trusted publishing:
164+
165+
1. **Trusted publisher not configured yet** — Go to npmjs.com and configure the trusted publisher (Step 1 above)
166+
2. **Configuration mismatch** — Double-check that Owner, Repository, and Workflow filename match EXACTLY
167+
3. **Environment mismatch** — If you specified an environment on npmjs.com, the workflow must use the same environment name (we leave it empty by default)
168+
163169
### "Unable to authenticate" error
164170

165171
- Verify the workflow filename matches **exactly** (`publish.yml`, not `Publish.yml`)

.github/workflows/publish.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ jobs:
2828
contents: read
2929
pull-requests: write
3030
id-token: write # Required for trusted publishing (OIDC)
31-
environment:
32-
name: Canary package in NPM
33-
url: https://www.npmjs.com/package/@cube-dev/ui-kit/v/${{ steps.version.outputs.version }}
3431
env:
3532
NODE_OPTIONS: --max-old-space-size=4096
3633
outputs:

0 commit comments

Comments
 (0)