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
feat: enhance git-cliff GitHub integration and npm trusted publishing (#2)
- Update cliff.toml to support filtering commits by PR labels and include new contributor recognition in changelogs.
- Add validation step in CI workflow to ensure proper changelog format and structure.
- Improve publish-release.yml and version-bump.yml workflows for trusted npm publishing with OIDC.
- Enhance README with detailed explanations of GitHub integration features and squash merge support.
This update aims to streamline changelog generation and improve the overall release process.
Co-authored-by: JSONbored <49853598+gh0stdotexe@users.noreply.github.com>
- PR link is automatically added: `([#42](https://github.com/JSONbored/safemocker/pull/42))`
303
+
304
+
### Configuration
305
+
306
+
The `commit_preprocessors` in `cliff.toml` handle:
307
+
- Standard GitHub PR merge messages: `Merge pull request #123`
308
+
- PR references in commit messages: `(#123)`
309
+
- Squash merge commits (processed automatically)
310
+
311
+
## npm Trusted Publishing
312
+
313
+
### Overview
314
+
315
+
The release workflow uses **npm Trusted Publishing** with OIDC (OpenID Connect) for secure, tokenless authentication. This eliminates the need for `NODE_AUTH_TOKEN` secrets.
316
+
317
+
### Requirements
318
+
319
+
1.**Environment name**: Must match npm trusted publisher configuration (currently `production`)
320
+
2.**Permissions**: `id-token: write` is required (already set in workflow)
321
+
3.**setup-node order**: Must be configured **before** pnpm setup for OIDC to work
322
+
4.**registry-url**: Must be set to `https://registry.npmjs.org`
323
+
5.**--provenance flag**: Creates signed provenance statements
324
+
325
+
### How It Works
326
+
327
+
1. GitHub Actions generates an OIDC token automatically
328
+
2.`setup-node@v4` with `registry-url` configures npm to use OIDC
329
+
3.`npm publish --provenance` uses the OIDC token for authentication
330
+
4. npm verifies the token against your trusted publisher configuration
331
+
5. Package is published with signed provenance
332
+
333
+
### Verification
334
+
335
+
After publishing, the workflow verifies the package is available on npm:
336
+
337
+
```bash
338
+
npm view "@jsonbored/safemocker@$VERSION" version
339
+
```
340
+
341
+
If this fails, the workflow will report an error.
342
+
343
+
### Troubleshooting npm Trusted Publishing
344
+
345
+
**Issue**: npm publish fails with authentication error
346
+
347
+
**Solutions**:
348
+
1. Verify environment name matches npm trusted publisher config (`production`)
349
+
2. Check that `id-token: write` permission is set in workflow
350
+
3. Ensure `setup-node` is configured before `pnpm/action-setup`
351
+
4. Verify `registry-url: 'https://registry.npmjs.org'` is set
0 commit comments