Repository navigation
Release 0.2.1: restore npm identity, fix package validation, publish via OIDC #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
bfaf47c
fix: retain existing npm package identity
gitdamnit d46bd59
fix: align npm lockfile with existing package
gitdamnit d3b0848
ci: require manual approval for npm publication
gitdamnit 63ff884
fix: restore npm package identity and publish via OIDC
gitdamnit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,71 @@ | ||
| # Manual release publishing using npm Trusted Publishing (OIDC). | ||
| # Never triggered by a GitHub release or tag push. | ||
| name: Publish to npm | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Existing release tag (for example v0.3.0)" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish package | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repo | ||
| - name: Validate input and checkout tag | ||
| env: | ||
| RELEASE_TAG: ${{ inputs.tag }} | ||
| run: | | ||
| set -eu | ||
| if ! printf '%s' "$RELEASE_TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then | ||
| echo "Expected a stable release tag such as v1.2.3" >&2 | ||
| exit 1 | ||
| fi | ||
| - name: Checkout release tag | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ inputs.tag }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node | ||
| - name: Set up Node for npm Trusted Publishing | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| registry-url: https://registry.npmjs.org/ | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Compile detection rules from TOML | ||
| run: npm run build:rules | ||
|
|
||
| - name: Typecheck | ||
| run: npm run typecheck | ||
| node-version: '24' | ||
| registry-url: https://registry.npmjs.org | ||
| package-manager-cache: false | ||
|
|
||
| - name: Lint | ||
| run: npm run lint | ||
| - name: Require current npm OIDC client | ||
| run: npm install --global 'npm@^11.5.1' | ||
|
|
||
| - name: Unit tests | ||
| run: npm run test:unit | ||
|
|
||
| - name: Integration tests | ||
| run: npm run test:integration | ||
|
|
||
| - name: Security regression tests | ||
| run: npm run test:security | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
| - name: Verify version and tag | ||
| env: | ||
| RELEASE_TAG: ${{ inputs.tag }} | ||
| run: | | ||
| set -eu | ||
| actual="$(node -p "require('./package.json').version")" | ||
| test "$RELEASE_TAG" = "v$actual" || { | ||
| echo "Version mismatch: $RELEASE_TAG vs $actual" >&2 | ||
| exit 1 | ||
| } | ||
| echo "Verified release $RELEASE_TAG" | ||
|
|
||
| - name: Package validation | ||
| run: npm run verify:package | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Build and validate | ||
| run: | | ||
| npm run build | ||
| npm run typecheck | ||
| npm run lint | ||
| npm run test:unit | ||
| npm run test:integration | ||
| npm run test:security | ||
| npm run verify:package | ||
|
|
||
| - name: Publish to npm | ||
| run: npm publish --provenance --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| - name: Publish using OIDC | ||
| run: npm publish --access public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The package is now version 0.2.1, but
src/shared/version.tsstill exports"0.2.0"and the help banner insrc/cli/args.tsalso hardcodes 0.2.0. Consequently, the new release still identifies itself as 0.2.0 insd version, CLI help, and the plugin's status tool, making it impossible to distinguish the packaging fix through those interfaces. Running the checked-in CLI confirmsstrangerDanger v0.2.0. Update these runtime strings with the release bump; the package verifier currently accepts any semver-shaped version output and will not catch the mismatch.Useful? React with 👍 / 👎.