Conversation
- Bump version to 4.6.0 in all package.json files - Add CHANGELOG entry for v4.6.0 - Update publish workflow: replace deprecated actions/create-release with gh release create, attach dist files (less.js, less.min.js) as release assets, bump contents permission to write - Remove .github/** from paths-ignore (was preventing workflow updates) - Update CONTRIBUTING.md with detailed release documentation version: 4.6.0
📝 WalkthroughWalkthroughConsolidates GitHub release steps into a single release run using the GitHub CLI, updates workflow permissions and triggers, centralizes alpha vs. master release logic, bumps packages to v4.6.0, updates changelog and contributing docs, and adds version-ahead-of-tag detection to the bump script. Changes
Sequence Diagram(s)sequenceDiagram
participant GH_Actions as "GitHub Actions"
participant Script as "bump-and-publish.js"
participant Builder as "Build (pnpm/npm)"
participant GH_CLI as "gh (GitHub CLI)"
participant NPM as "npm registry"
GH_Actions->>Script: start release job (determine version, IS_ALPHA)
Script->>Builder: run build to produce assets (`less.js`, `less.min.js`)
Builder-->>Script: assets produced
Script->>GH_CLI: `gh release create <version>` (attach assets, --prerelease if alpha)
GH_CLI->>GH_Actions: create release & attach assets
Script->>NPM: `npm publish` (tag depends on alpha/master)
NPM-->>Script: publish result
GH_Actions-->>GH_Actions: workflow completes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
CONTRIBUTING.md (1)
111-115: Add language specifier to fenced code block.The commit message example should have a language specifier for consistency with other code blocks in the file. Using
textor leaving it empty with proper formatting would satisfy the markdown linter.Suggested fix
-``` +```text feat: new feature version: 4.6.0</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@CONTRIBUTING.mdaround lines 111 - 115, Update the fenced code block that
currently shows the commit example (the block containing "feat: new feature" and
"version: 4.6.0") to include a language specifier (e.g., use ```text) so the
markdown linter is satisfied and the block matches other examples in the
document.</details> </blockquote></details> <details> <summary>scripts/bump-and-publish.js (1)</summary><blockquote> `487-489`: **Duplicate `require('fs')` statement.** The `fs` module is already required at line 14. This duplicate require inside the function is unnecessary. <details> <summary>Suggested fix</summary> ```diff // Output version for GitHub Actions if (process.env.GITHUB_OUTPUT) { - const fs = require('fs'); fs.appendFileSync(process.env.GITHUB_OUTPUT, `version=${nextVersion}\n`); fs.appendFileSync(process.env.GITHUB_OUTPUT, `tag=${tagName}\n`); } ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In `@scripts/bump-and-publish.js` around lines 487 - 489, Remove the duplicate require('fs') inside the if block and use the already-imported fs variable (so delete the line "const fs = require('fs');" in the block that checks process.env.GITHUB_OUTPUT) to avoid shadowing and redundant requires; keep the existing call to fs.appendFileSync(process.env.GITHUB_OUTPUT, `version=${nextVersion}\n`) unchanged. ``` </details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In@CONTRIBUTING.md:
- Around line 111-115: Update the fenced code block that currently shows the
commit example (the block containing "feat: new feature" and "version: 4.6.0")
to include a language specifier (e.g., use ```text) so the markdown linter is
satisfied and the block matches other examples in the document.In
@scripts/bump-and-publish.js:
- Around line 487-489: Remove the duplicate require('fs') inside the if block
and use the already-imported fs variable (so delete the line "const fs =
require('fs');" in the block that checks process.env.GITHUB_OUTPUT) to avoid
shadowing and redundant requires; keep the existing call to
fs.appendFileSync(process.env.GITHUB_OUTPUT,version=${nextVersion}\n)
unchanged.</details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Pro **Run ID**: `cb6fe718-dabd-4301-9c6b-0a62ba18bb9a` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between e6a8efbb9c4d832fcf236fbeb570f92c1109b323 and a08bd0dfea6585d466dbf24030c1fda6ab5a1b39. </details> <details> <summary>📒 Files selected for processing (8)</summary> * `.github/workflows/publish.yml` * `CHANGELOG.md` * `CONTRIBUTING.md` * `package.json` * `packages/less/package.json` * `packages/test-data/package.json` * `packages/test-import-module/package.json` * `scripts/bump-and-publish.js` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
- Add repository field to test-data package.json (fixes npm OIDC
provenance verification failure)
- Skip publish workflow on forks (only run on less/less.js)
- Remove duplicate require('fs') in bump-and-publish.js
- Add language specifier to markdown code block in CONTRIBUTING.md
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/publish.yml:
- Around line 147-192: The Create GitHub Release step can fail if a release with
$TAG already exists; modify the step to first check for an existing release
(e.g., use gh release view "$TAG") and branch: if it exists, run gh release edit
"$TAG" to update --title and --notes and use gh release upload to update the
assets (packages/less/dist/less.js and packages/less/dist/less.min.js),
otherwise run gh release create "$TAG" as currently done; ensure the same
PRERELEASE flag and BODY are applied when editing and that upload
replaces/overwrites existing assets to make the step idempotent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 08f663b0-c82e-4611-9418-0bae5279c7f5
📒 Files selected for processing (4)
.github/workflows/publish.ymlCONTRIBUTING.mdpackages/test-data/package.jsonscripts/bump-and-publish.js
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/publish.yml (1)
187-190:⚠️ Potential issue | 🟡 MinorExisting-release reruns still leave release metadata stale.
On reruns, Line 187 takes the existing-release path and only re-uploads assets. If
TITLE,BODY, or prerelease status changed, the GitHub release will not be brought back in sync. This is still only partially idempotent.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/publish.yml around lines 187 - 190, The workflow currently treats an existing release (checked via gh release view "$TAG") as immutable and only re-uploads assets, which leaves TITLE, BODY (notes) and prerelease state stale on reruns; update the existing-release branch to call gh release edit for the found TAG and pass the latest metadata (e.g., --title "$TITLE", --notes "$BODY", and set/remove --prerelease based on the prerelease flag) before uploading assets so the release metadata is brought back into sync with the action inputs; ensure you still run gh release upload --clobber after the gh release edit to update assets.
🧹 Nitpick comments (1)
.github/workflows/publish.yml (1)
132-133: Pin npm to the required range instead oflatest.
npm@latestmakes the release path non-reproducible and can start failing on a future npm major even though this step only needs11.5.1+. Pinning the major/range here would keep publishing behavior stable.Proposed change
- - name: Ensure npm 11.5.1 or later for trusted publishing - run: npm install -g npm@latest + - name: Ensure npm 11.5.1 or later for trusted publishing + run: npm install -g "npm@^11.5.1"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/publish.yml around lines 132 - 133, Replace the non-reproducible global install "npm install -g npm@latest" in the workflow step named "Ensure npm 11.5.1 or later for trusted publishing" with a pinned semver range that guarantees npm 11.x and at least 11.5.1 (for example use npm@^11.5.1 or an explicit range like ">=11.5.1 <12") so the publish job stays stable; update the run command accordingly and verify the workflow runs with the pinned version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/publish.yml:
- Around line 187-190: The workflow currently treats an existing release
(checked via gh release view "$TAG") as immutable and only re-uploads assets,
which leaves TITLE, BODY (notes) and prerelease state stale on reruns; update
the existing-release branch to call gh release edit for the found TAG and pass
the latest metadata (e.g., --title "$TITLE", --notes "$BODY", and set/remove
--prerelease based on the prerelease flag) before uploading assets so the
release metadata is brought back into sync with the action inputs; ensure you
still run gh release upload --clobber after the gh release edit to update
assets.
---
Nitpick comments:
In @.github/workflows/publish.yml:
- Around line 132-133: Replace the non-reproducible global install "npm install
-g npm@latest" in the workflow step named "Ensure npm 11.5.1 or later for
trusted publishing" with a pinned semver range that guarantees npm 11.x and at
least 11.5.1 (for example use npm@^11.5.1 or an explicit range like ">=11.5.1
<12") so the publish job stays stable; update the run command accordingly and
verify the workflow runs with the pinned version.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 46a13c19-ffe7-44a9-9afb-1ec79577802c
📒 Files selected for processing (1)
.github/workflows/publish.yml
Summary
actions/create-release@v1withgh release create, attachless.jsandless.min.jsas release assets.github/**frompaths-ignoreso workflow file changes trigger CICloses
Closes #4397
Closes #4354
Closes #4339
Closes #4313
Closes #4396
Closes #4395
Closes #4394
Test plan
dist/less.jsanddist/less.min.jsSummary by CodeRabbit
New Features
Bug Fixes
Deprecation Warnings
Documentation
Release