Skip to content

chore: update release process to use GitHub Release API - #33

Merged
alehar9320 merged 5 commits into
mainfrom
topic/fix-build-error-branch-rules
Apr 5, 2026
Merged

alehar9320 merged 5 commits into
mainfrom
topic/fix-build-error-branch-rules

Conversation

@alehar9320

@alehar9320 alehar9320 commented Apr 3, 2026 •

Copy link
Copy Markdown
Owner
  • 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

Summary by CodeRabbit

  • Chores
    • Deployment pipeline now creates and publishes GitHub Releases automatically, using a generated release version and a changelog excerpt for clearer release history.
    • Local release tooling simplified to emit release metadata for the CI pipeline, reducing local-side repository changes and streamlining the release process.

- 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>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@coderabbitai

coderabbitai Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
Workflow: release & publish
.github/workflows/ci.yml
Adds id: release to the node scripts/release.js step, extracts RELEASE_VERSION and a multi-line RELEASE_CHANGELOG into $GITHUB_ENV, and adds a step using softprops/action-gh-release@v2 to create a GitHub Release with tag_name from RELEASE_VERSION and body from RELEASE_CHANGELOG.
Release script: emit metadata
scripts/release.js
Removes git configuration, commit/tag/push logic and instead writes version and URL-encoded changelog to GITHUB_OUTPUT and prints workflow notices; no direct repo mutations remain.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating the release process to use GitHub Release API instead of local git operations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch topic/fix-build-error-branch-rules

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

116-117: Unused step id.

The id: release is assigned but steps.release.outputs.* is never referenced in the workflow. Either remove the unused id or use the outputs from release.js (after fixing the deprecated ::set-output syntax).

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ffbaa7 and 1b2bb0a.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • scripts/release.js

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment thread scripts/release.js Outdated
- 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>
@codecov-commenter

codecov-commenter commented Apr 4, 2026 •

Copy link
Copy Markdown

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 ☂️

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cfced549-cea7-4308-bd2f-4ebcacd54ddc

📥 Commits

Reviewing files that changed from the base of the PR and between 1b2bb0a and 45e78f9.

📒 Files selected for processing (1)
  • scripts/release.js

Comment thread scripts/release.js Outdated
- 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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/release.js (1)

79-80: Use multiline GitHub output format for changelog instead of URI encoding.

The current implementation URI-encodes the changelog on line 80, but the workflow (.github/workflows/ci.yml) does not consume steps.release.outputs.changelog. Instead, it independently reads CHANGELOG.md using 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

📥 Commits

Reviewing files that changed from the base of the PR and between 45e78f9 and 2580a6c.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • scripts/release.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

Comment thread scripts/release.js
alehar9320 and others added 2 commits April 5, 2026 20:49
- 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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
scripts/release.js (1)

75-81: changelog output uses a custom format the workflow can't consume directly.

GitHub's documented step-output contract is plain name=value, with multiline values using name<<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-123 doesn't decode or consume that output, so the extra changelog output 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2580a6c and 5a76375.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • scripts/release.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

@alehar9320
alehar9320 merged commit 9c8d990 into main Apr 5, 2026
10 checks passed
@alehar9320
alehar9320 deleted the topic/fix-build-error-branch-rules branch April 5, 2026 19:22
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.

2 participants