Repository navigation
chore: update release process to use GitHub Release API - #33
Conversation
- Simplify release.js to output version/changelog instead of handling git - Move git tagging and release creation to CI workflow - Extract release info in separate workflow step for clarity - Use softprops/action-gh-release@v2 for creating GitHub Release Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
me | 5a76375 | Commit Preview URL Branch Preview URL |
Apr 05 2026, 06:52 PM |
📝 WalkthroughWalkthroughThe Node release script no longer performs git operations; it emits GitHub Actions outputs (version and changelog). The CI workflow captures those outputs, sets RELEASE_* env vars, creates a git tag, and publishes a GitHub Release using the changelog and tag. Changes
Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Actions Workflow
participant Script as scripts/release.js
participant Git as Git (repo)
participant GH as GitHub API
Workflow->>Script: run `node scripts/release.js` (id: release)
Script->>Script: determine version & extract changelog
Script-->>Workflow: emit outputs (`version`, `changelog`) via GITHUB_OUTPUT
Workflow->>Git: create tag using env.RELEASE_VERSION
Workflow->>GH: invoke softprops/action-gh-release with tag_name & body (RELEASE_CHANGELOG)
GH->>GH: create GitHub Release
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
116-117: Unused stepid.The
id: releaseis assigned butsteps.release.outputs.*is never referenced in the workflow. Either remove the unused id or use the outputs fromrelease.js(after fixing the deprecated::set-outputsyntax).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 116 - 117, The workflow assigns an unused step id "release" (id: release) but never reads steps.release.outputs.*; either remove the id or wire its outputs into the job. Fix by either (A) deleting or renaming/removing the "id: release" line so there’s no unused identifier, or (B) update the release step implementation (release.js) to emit outputs using the newer GitHub Actions output mechanism (avoid deprecated ::set-output), expose them as step outputs, and reference them where needed via steps.release.outputs.<outputName>; choose the option that matches intended behavior and ensure any references use the new output names.
🤖 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/ci.yml:
- Around line 126-130: The "Create Git Tag" workflow step creates a local tag
but never pushes it; either delete this step so softprops/action-gh-release
creates the tag on GitHub, or modify the step to push the tag after creation
(e.g., run git push origin ${ env.RELEASE_VERSION } or git push --tags). Update
the step named "Create Git Tag" in the ci.yml to implement one of these two
options and ensure consistency with the softprops/action-gh-release usage.
- Around line 118-124: The workflow step "Extract Release Info" recalculates the
timestamped version independently, causing a race with release.js; instead, read
the version that release.js already publishes (e.g., via $GITHUB_OUTPUT or the
written version.json) and use that value for RELEASE_VERSION and
RELEASE_CHANGELOG; update the step to consume the release.js output (the output
name or version.json key created by release.js) rather than generating a new
timestamp, ensuring RELEASE_VERSION and the changelog come from the same source
produced by release.js.
In `@scripts/release.js`:
- Around line 75-88: The three deprecated console.log lines using ::set-output
(referencing version and changelogEntry) should be replaced with the modern
GitHub Actions env-file approach: if you need to keep these outputs, append
lines like `version=${version}` and
`changelog=${encodeURIComponent(changelogEntry)}` to process.env.GITHUB_OUTPUT
using fs.appendFileSync; otherwise remove those console.log calls entirely (they
are redundant because the workflow recalculates version and reads CHANGELOG.md)
and keep only the notice console.log; also ensure any temp file logic around
tempChangelogPath remains consistent with this change.
---
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 116-117: The workflow assigns an unused step id "release" (id:
release) but never reads steps.release.outputs.*; either remove the id or wire
its outputs into the job. Fix by either (A) deleting or renaming/removing the
"id: release" line so there’s no unused identifier, or (B) update the release
step implementation (release.js) to emit outputs using the newer GitHub Actions
output mechanism (avoid deprecated ::set-output), expose them as step outputs,
and reference them where needed via steps.release.outputs.<outputName>; choose
the option that matches intended behavior and ensure any references use the new
output names.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 34fda206-4e6c-4651-8101-a9853b598e04
📒 Files selected for processing (2)
.github/workflows/ci.ymlscripts/release.js
- Remove redundant ::set-output console.log calls (workflow recalculates version and reads CHANGELOG.md) - Remove unnecessary temp file logic - Keep only ::notice console.log for clarity - Simplify release.js output handling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
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 `@scripts/release.js`:
- Around line 75-77: The script currently prints the release version via
console.log (`version`) but relies on the workflow to recompute it; change the
script to emit deterministic outputs for the workflow by writing the computed
version and generated changelog into GitHub Actions outputs (instead of just
logging): after you compute `version` and the `changelog` string in
scripts/release.js, write them to the GITHUB_OUTPUT file (or use the proper
Actions output mechanism) so the workflow step can consume
`steps.release.outputs.version` and `steps.release.outputs.changelog`; keep the
existing notice logs (the `console.log` lines) but add the output writes
immediately after the values are available.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
- Write version and changelog to GITHUB_OUTPUT for workflow consumption - Update workflow to use steps.release.outputs.version instead of recomputing - Eliminates redundant version calculation in Extract Release Info step - Script now provides deterministic outputs for downstream steps - Keep console.log notices for visibility Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/release.js (1)
79-80: Use multiline GitHub output format forchangeloginstead of URI encoding.The current implementation URI-encodes the changelog on line 80, but the workflow (
.github/workflows/ci.yml) does not consumesteps.release.outputs.changelog. Instead, it independently readsCHANGELOG.mdusing the multiline syntax. If this output is intended for use, the multiline format is more maintainable than URI encoding and aligns with the approach already used elsewhere in the workflows.♻️ Proposed refactor
- fs.appendFileSync(githubOutput, `changelog=${encodeURIComponent(changelogEntry)}\n`); + fs.appendFileSync(githubOutput, `changelog<<EOF\n${changelogEntry}EOF\n`);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/release.js` around lines 79 - 80, Replace the URI-encoded changelog write with GitHub Actions' multiline output syntax: instead of fs.appendFileSync(githubOutput, `changelog=${encodeURIComponent(changelogEntry)}\n`), append a heredoc-style multiline output to the githubOutput file using the `changelog<<EOF` ... `EOF` pattern so the full changelogEntry is preserved; update the line that references githubOutput and changelogEntry accordingly and remove the encodeURIComponent usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/release.js`:
- Around line 77-84: The write-to-GITHUB_OUTPUT block currently swallows
failures by logging a warning; update the try/catch around fs.appendFileSync
(the block that writes githubOutput using version and changelogEntry) to fail
fast instead—either rethrow the caught error or call process.exit(1) after
logging so the script exits non‑zero when writing outputs fails, ensuring
subsequent tag/release steps cannot proceed with missing outputs.
---
Nitpick comments:
In `@scripts/release.js`:
- Around line 79-80: Replace the URI-encoded changelog write with GitHub
Actions' multiline output syntax: instead of fs.appendFileSync(githubOutput,
`changelog=${encodeURIComponent(changelogEntry)}\n`), append a heredoc-style
multiline output to the githubOutput file using the `changelog<<EOF` ... `EOF`
pattern so the full changelogEntry is preserved; update the line that references
githubOutput and changelogEntry accordingly and remove the encodeURIComponent
usage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e2419aa7-c9ff-4817-b862-b58a94b4d1e6
📒 Files selected for processing (2)
.github/workflows/ci.ymlscripts/release.js
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/ci.yml
- Delete 'Create Git Tag' step that created local tags but never pushed - softprops/action-gh-release@v2 handles tag creation on GitHub automatically - Eliminates redundancy and potential for divergence between local and remote tags - Ensures single source of truth: GitHub Release action manages both tag and release Why this fix: - Previous step created tag locally but didn't push it - GitHub Release action creates the tag anyway - Results in unused local tags that won't sync to remote - Cleaner, simpler workflow with no duplicated git operations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change console.warn to console.error for clarity - Call process.exit(1) after error to fail immediately - Prevents downstream workflow steps from proceeding with missing outputs - Ensures script exits non-zero when outputs cannot be written Why this matters: - Previous behavior swallowed errors and continued execution - If GITHUB_OUTPUT write fails, workflow steps don't have version/changelog - Failing fast ensures GitHub Release step doesn't run with incomplete data - Clearer signal to CI/CD that release preparation failed Before: Continued with warning even if outputs failed to write After: Exits immediately (exit code 1) and blocks subsequent steps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/release.js (1)
75-81:changelogoutput uses a custom format the workflow can't consume directly.GitHub's documented step-output contract is plain
name=value, with multiline values usingname<<DELIM; for arbitrary multiline content, it recommends writing to a file instead. Here we're percent-encoding the Markdown instead, and.github/workflows/ci.yml:114-123doesn't decode or consume that output, so the extrachangelogoutput is misleading and won't round-trip cleanly without more workflow logic. (docs.github.com)♻️ Suggested cleanup
-// Write outputs to GitHub Actions for workflow consumption +// Write version output to GitHub Actions for workflow consumption const githubOutput = process.env.GITHUB_OUTPUT; if (githubOutput) { try { fs.appendFileSync(githubOutput, `version=${version}\n`); - fs.appendFileSync(githubOutput, `changelog=${encodeURIComponent(changelogEntry)}\n`); - console.log('Outputs written to GITHUB_OUTPUT'); + console.log('Version output written to GITHUB_OUTPUT'); } catch (e) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/release.js` around lines 75 - 81, The current step writes a percent-encoded changelogEntry to GITHUB_OUTPUT (via githubOutput) which the workflow won't decode; instead stop writing raw/encoded changelog to the step output and write the full multiline changelogEntry to a dedicated file (e.g., create a temp file like changelog.txt), then append only a simple name=path output (e.g., changelog_path=<path>) and the version to GITHUB_OUTPUT; update the block that uses githubOutput (and variables version and changelogEntry) to create the file, write changelogEntry into it as UTF-8, and append the file path (not the content) to GITHUB_OUTPUT so the workflow can consume the file safely.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@scripts/release.js`:
- Around line 75-81: The current step writes a percent-encoded changelogEntry to
GITHUB_OUTPUT (via githubOutput) which the workflow won't decode; instead stop
writing raw/encoded changelog to the step output and write the full multiline
changelogEntry to a dedicated file (e.g., create a temp file like
changelog.txt), then append only a simple name=path output (e.g.,
changelog_path=<path>) and the version to GITHUB_OUTPUT; update the block that
uses githubOutput (and variables version and changelogEntry) to create the file,
write changelogEntry into it as UTF-8, and append the file path (not the
content) to GITHUB_OUTPUT so the workflow can consume the file safely.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 67192b53-a7d8-4eba-94c8-2c1516560106
📒 Files selected for processing (2)
.github/workflows/ci.ymlscripts/release.js
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/ci.yml
Summary by CodeRabbit