Skip to content

chore: allow publishing of identical npm package versions#75

Merged
shuhuiluo merged 1 commit into
mainfrom
shuhui/pub
Aug 13, 2025
Merged

chore: allow publishing of identical npm package versions#75
shuhuiluo merged 1 commit into
mainfrom
shuhui/pub

Conversation

@shuhuiluo

@shuhuiluo shuhuiluo commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

Added --allow-same-version flag to npm version command in the GitHub Actions workflow, enabling publishing of packages with the same version number.

Summary by CodeRabbit

  • Chores
    • Updated release automation to permit publishing when the specified version matches the current package version, preventing unnecessary failures while continuing to avoid creating git tags. This improves reliability of our publish process. All existing behavior, including version sanitization and publication steps, remains the same. This change streamlines CI runs for releases with unchanged versions and reduces operational noise.

Added `--allow-same-version` flag to `npm version` command in the GitHub Actions workflow, enabling publishing of packages with the same version number.
@coderabbitai

coderabbitai Bot commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The workflow .github/workflows/npm-publish.yml updates the npm version command to include --allow-same-version alongside --no-git-tag-version, allowing version setting to succeed when unchanged. Version sanitization (stripping leading 'v') and the npm publish step remain as before.

Changes

Cohort / File(s) Summary
CI/CD Workflow
.github/workflows/npm-publish.yml
Modify npm version step to add --allow-same-version while retaining --no-git-tag-version; no other workflow logic changed.

Sequence Diagram(s)

sequenceDiagram
  participant GH as GitHub Actions
  participant NPM as npm CLI

  GH->>GH: Extract and sanitize version (remove leading 'v')
  GH->>NPM: npm version <version> --no-git-tag-version --allow-same-version
  NPM-->>GH: Succeeds even if version unchanged
  GH->>NPM: npm publish
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit taps the version key,
“Same as before? That’s fine,” says he.
No tag to chase, no failing fright,
Just publish hops into the night.
Thump-thump—release is set just right.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a42a5d8 and 9a18d72.

📒 Files selected for processing (1)
  • .github/workflows/npm-publish.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/npm-publish.yml (1)

47-47: Good addition: prevents spurious failures when the target equals package.json.

Adding --allow-same-version avoids unnecessary failures in cases where package.json already carries the intended version.

Please confirm the intended scenarios:

  • A. package.json already has VERSION, but it’s not yet published (this change helps).
  • B. VERSION is already published (this change won’t allow re-publish; add the guard suggested above).
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch shuhui/pub

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@shuhuiluo shuhuiluo enabled auto-merge August 13, 2025 03:25
@shuhuiluo shuhuiluo added this pull request to the merge queue Aug 13, 2025
Merged via the queue into main with commit bce6818 Aug 13, 2025
2 checks passed
@shuhuiluo shuhuiluo deleted the shuhui/pub branch August 13, 2025 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant