You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository is configured to use NPM's [Trusted Publishers](https://docs.npmjs.com/trusted-publishers) feature with OIDC authentication via GitHub Actions.
3
+
This repository is configured to publish packages to NPM via GitHub Actions using a standard NPM authentication token.
4
4
5
5
## How It Works
6
6
7
-
When a new release is created on GitHub, the workflow automatically publishes the package to NPM using short-lived OIDC tokens instead of long-lived NPM tokens. This provides better security and includes cryptographic provenance attestations.
7
+
When a new release is created on GitHub, the workflow automatically publishes the package to NPM using the NPM_TOKEN secret.
8
8
9
9
## Setup Instructions
10
10
11
-
To complete the trusted publisher configuration, a package maintainer needs to:
11
+
To configure NPM publishing, a package maintainer needs to:
12
12
13
-
1. Go to [npmjs.com](https://www.npmjs.com) and log in
14
-
2. Navigate to the package: [@kulkul/tinyurl-client](https://www.npmjs.com/package/@kulkul/tinyurl-client)
15
-
3. Go to **Settings** → **Publishing** (or access directly at: `https://www.npmjs.com/package/@kulkul/tinyurl-client/access`)
16
-
4. Click **"Add trusted publisher"**
17
-
5. Configure with these details:
18
-
-**Provider**: GitHub Actions
19
-
-**Organization**: `kulkultech`
20
-
-**Repository**: `tinyurl-client`
21
-
-**Workflow**: `test-and-publish.yml`
22
-
-**Environment**: Leave blank (not using deployment environments)
13
+
1. Generate an NPM automation token at [npmjs.com](https://www.npmjs.com)
14
+
2. Add the token as a GitHub secret:
15
+
- Go to repository **Settings** → **Secrets and variables** → **Actions**
16
+
- Click **"New repository secret"**
17
+
- Name: `NODE_AUTH_TOKEN`
18
+
- Value: Your NPM automation token
23
19
24
20
## Publishing a New Version
25
21
@@ -29,19 +25,18 @@ To complete the trusted publisher configuration, a package maintainer needs to:
29
25
4. The GitHub Actions workflow will automatically:
30
26
- Run tests
31
27
- Build the package
32
-
- Publish to NPM with provenance attestations
28
+
- Publish to NPM
33
29
34
30
## Benefits
35
31
36
-
- 🔒 **Enhanced Security**: No long-lived NPM tokens stored as secrets
37
-
- ✅ **Provenance**: Cryptographic proof of where and how the package was built
38
32
- 🤖 **Automated**: Fully automated publishing on release creation
39
-
- 🔍 **Transparent**: Build logs and provenance are publicly verifiable
33
+
- ✅ **Tested**: Package is only published after tests pass
34
+
- 🔍 **Transparent**: Build logs are publicly available
40
35
41
36
## Troubleshooting
42
37
43
38
If publishing fails:
44
-
1. Ensure the trusted publisher is configured on npmjs.com
45
-
2. Verify the repository, workflow name, and organization match exactly
39
+
1. Ensure the `NODE_AUTH_TOKEN` secret is configured correctly
40
+
2. Verify the NPM token has appropriate permissions
46
41
3. Check that the release was created (not just a tag)
47
42
4. Review the GitHub Actions logs for detailed error messages
0 commit comments