Skip to content

Commit c7b7bc7

Browse files
ochafikclaude
andcommitted
Switch to npm trusted publishing (OIDC)
- Remove NPM_TOKEN secret requirement from npm-publish workflow - Uses OIDC for authentication (more secure, no long-lived tokens) - Update CONTRIBUTING.md with trusted publisher setup instructions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 2df7ade commit c7b7bc7

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

.github/workflows/npm-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
publish:
4646
runs-on: ubuntu-latest
4747
if: github.event_name == 'release'
48-
environment: release
48+
environment: Release
4949
needs: [build, test]
5050

5151
permissions:
@@ -80,6 +80,6 @@ jobs:
8080
echo "tag=" >> $GITHUB_OUTPUT
8181
fi
8282
83+
# Uses OIDC trusted publishing - no NPM_TOKEN needed
84+
# Configure at: https://www.npmjs.com/package/@modelcontextprotocol/ext-apps/access
8385
- run: npm publish --provenance --access public ${{ steps.npm-tag.outputs.tag }}
84-
env:
85-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CONTRIBUTING.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,21 @@ Please review our [Security Policy](SECURITY.md) for reporting security vulnerab
6060

6161
### Repository Setup
6262

63-
Before publishing releases, ensure the following are configured:
63+
This repository uses [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/) with OIDC - no secrets required.
6464

65-
1. **NPM_TOKEN secret**: Add an npm automation token to the repository secrets
66-
- Go to Settings � Secrets and variables � Actions
67-
- Create a new secret named `NPM_TOKEN`
68-
- Value: an npm automation token with publish permissions for `@modelcontextprotocol/ext-apps`
65+
Before publishing releases, ensure the following are configured:
6966

70-
2. **`release` environment** (optional): Create a protected environment for additional safeguards
71-
- Go to Settings � Environments � New environment
72-
- Name it `release`
67+
1. **Trusted publisher on npm**: Configure the package to trust this GitHub repository
68+
- Go to https://www.npmjs.com/package/@modelcontextprotocol/ext-apps/access
69+
- Under "Trusted Publishers", click "Add trusted publisher"
70+
- Select "GitHub Actions"
71+
- Repository: `modelcontextprotocol/ext-apps`
72+
- Workflow filename: `npm-publish.yml`
73+
- Environment: `Release` (optional, for additional protection)
74+
75+
2. **`Release` environment** (optional): Create a protected environment for additional safeguards
76+
- Go to Settings > Environments > New environment
77+
- Name it `Release`
7378
- Add required reviewers or other protection rules as needed
7479

7580
### Publishing a Release

0 commit comments

Comments
 (0)