-
Notifications
You must be signed in to change notification settings - Fork 35
Publish-Profile #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Publish-Profile #226
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||
| # Publish Package Workflow for https://docs.npmjs.com/trusted-publishers | ||||||
| name: Publish Package | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| tags: | ||||||
| - 'v*' | ||||||
|
|
||||||
| permissions: | ||||||
| id-token: write # Required for OIDC | ||||||
| contents: read | ||||||
|
|
||||||
| jobs: | ||||||
| publish: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Setup Node.js | ||||||
| uses: actions/setup-node@v6 | ||||||
| with: | ||||||
| node-version: 24 | ||||||
| registry-url: 'https://registry.npmjs.org' | ||||||
|
|
||||||
| - run: npm install | ||||||
|
|
||||||
| - run: make | ||||||
| - run: make tsc | ||||||
| - run: make test-headless | ||||||
| - run: make test-headless-jquery | ||||||
|
|
||||||
| - run: make link | ||||||
| - run: npx lerna publish from-package --yes --skip-npm --no-git-tag-version | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove The 🔎 Proposed fix to enable publishing- - run: npx lerna publish from-package --yes --skip-npm --no-git-tag-version
+ - run: npx lerna publish from-package --yes --no-git-tag-version📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: knockout/tko
Length of output: 271
🏁 Script executed:
Repository: knockout/tko
Length of output: 38
🏁 Script executed:
Repository: knockout/tko
Length of output: 766
🌐 Web query:
Lerna publish command npm OIDC trusted publishers GitHub Actions💡 Result:
Summary — using Lerna publish with npm OIDC (Trusted Publishers) from GitHub Actions
References
Would you like a ready-to-use GitHub Actions workflow example that runs lerna publish via OIDC?
🌐 Web query:
setup-node v6 npm OIDC authentication .npmrc configuration💡 Result:
Short how-to + examples.
Key points
Minimal workflow (publish with OIDC + install private deps)
contents: read
id-token: write
with:
node-version: 24
registry-url: 'https://registry.npmjs.org' # optional for npmjs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_READONLY }}
run: npm ci
run: npm publish
do NOT set NODE_AUTH_TOKEN for this step so npm uses OIDC
Example .npmrc patterns
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
@your-scope:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
Notes / requirements
Sources
[1] actions/setup-node (README).
[2] npm — Trusted publishing / OIDC docs.
[3] npm docs example (Trusted publishing workflow).
[4] blog/examples and community guides on OIDC trusted publishing.
Remove
--skip-npmflag from Lerna publish command.The workflow is correctly configured for OIDC trusted publishing (Lerna v9.0.3 supports it,
id-token: writepermission is set,setup-node@v6configures the registry), but the--skip-npmflag on line 33 prevents npm publishing entirely. This flag should be removed so the publish command actually pushes to npm. The OIDC token from GitHub Actions will be automatically used by npm CLI for authentication with the configured trusted publisher.🤖 Prompt for AI Agents