Skip to content

Commit 9a5271b

Browse files
Copilotempeje
andcommitted
Disable npm provenance to fix publishing issue
Co-authored-by: empeje <[email protected]>
1 parent f002d2b commit 9a5271b

2 files changed

Lines changed: 17 additions & 23 deletions

File tree

.github/PUBLISHING.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
# NPM Publishing Setup
22

3-
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.
44

55
## How It Works
66

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.
88

99
## Setup Instructions
1010

11-
To complete the trusted publisher configuration, a package maintainer needs to:
11+
To configure NPM publishing, a package maintainer needs to:
1212

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
2319

2420
## Publishing a New Version
2521

@@ -29,19 +25,18 @@ To complete the trusted publisher configuration, a package maintainer needs to:
2925
4. The GitHub Actions workflow will automatically:
3026
- Run tests
3127
- Build the package
32-
- Publish to NPM with provenance attestations
28+
- Publish to NPM
3329

3430
## Benefits
3531

36-
- 🔒 **Enhanced Security**: No long-lived NPM tokens stored as secrets
37-
-**Provenance**: Cryptographic proof of where and how the package was built
3832
- 🤖 **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
4035

4136
## Troubleshooting
4237

4338
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
4641
3. Check that the release was created (not just a tag)
4742
4. Review the GitHub Actions logs for detailed error messages

.github/workflows/test-and-publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ jobs:
3535
needs: test
3636
runs-on: ubuntu-latest
3737
if: github.event_name == 'release' && github.event.action == 'created'
38-
permissions:
39-
contents: read
40-
id-token: write
4138
steps:
4239
- uses: actions/checkout@v3
4340

@@ -55,4 +52,6 @@ jobs:
5552
run: yarn build
5653

5754
- name: Publish to NPM
58-
run: npm publish --provenance --access public
55+
run: npm publish --access public
56+
env:
57+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

0 commit comments

Comments
 (0)