Skip to content

Refactor release preparation workflow and add automated changelog upd…#102

Merged
YunchuWang merged 1 commit intomainfrom
wangbill/ru
Feb 10, 2026
Merged

Refactor release preparation workflow and add automated changelog upd…#102
YunchuWang merged 1 commit intomainfrom
wangbill/ru

Conversation

@YunchuWang
Copy link
Member

…ate script

Summary

What changed?

Why is this change needed?

Issues / work items

  • Resolves #
  • Related #

Project checklist

  • Release notes are not required for the next release
    • Otherwise: Notes added to CHANGELOG.md
  • Backport is not required
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • All required tests have been added/updated (unit tests, E2E tests)
  • Breaking change?
    • If yes:
      • Impact:
      • Migration guidance:

AI-assisted code disclosure (required)

Was an AI tool used? (select one)

  • No
  • Yes, AI helped write parts of this PR (e.g., GitHub Copilot)
  • Yes, an AI agent generated most of this PR

If AI was used:

  • Tool(s):
  • AI-assisted areas/files:
  • What you changed after AI output:

AI verification (required if AI was used):

  • I understand the code and can explain it
  • I verified referenced APIs/types exist and are correct
  • I reviewed edge cases/failure paths (timeouts, retries, cancellation, exceptions)
  • I reviewed concurrency/async behavior
  • I checked for unintended breaking or behavior changes

Testing

Automated tests

  • Result: Passed / Failed (link logs if failed)

Manual validation (only if runtime/behavior changed)

  • Environment (OS, Node.js version, components):
  • Steps + observed results:
    1.
    2.
    3.
  • Evidence (optional):

Notes for reviewers

  • N/A

Copilot AI review requested due to automatic review settings February 10, 2026 19:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the release preparation GitHub Actions workflow by extracting the changelog update logic into a dedicated Node.js script and simplifying PR body generation to avoid YAML escaping pitfalls.

Changes:

  • Added scripts/update-changelog.js to update CHANGELOG.md during release prep.
  • Updated .github/workflows/prepare-release.yaml to call the new script instead of inline node -e logic.
  • Updated PR creation step to generate the PR body via a temporary markdown file (--body-file).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scripts/update-changelog.js New script that inserts a new release section into CHANGELOG.md and resets the Upcoming section.
.github/workflows/prepare-release.yaml Uses the new changelog update script and writes PR body to /tmp/pr_body.md for gh pr create.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2 to +14
// This script updates CHANGELOG.md with a new release section
// Usage: node update-changelog.js <version> <date> <changelog-file>

const fs = require('fs');

const [,, version, releaseDate, changelogFile] = process.argv;

if (!version || !releaseDate || !changelogFile) {
console.error('Usage: node update-changelog.js <version> <date> <changelog-file>');
process.exit(1);
}

const changelogContent = fs.readFileSync(changelogFile, 'utf8').trim();
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The script’s CLI contract/documentation is misleading: the third arg is named like a changelog file to update, but the script always reads/writes the hard-coded CHANGELOG.md and uses the arg only as the source of release notes. Consider renaming the arg/usage text (e.g., release-notes-file) or adding an explicit target path parameter and using it instead of hard-coding CHANGELOG.md.

Suggested change
// This script updates CHANGELOG.md with a new release section
// Usage: node update-changelog.js <version> <date> <changelog-file>
const fs = require('fs');
const [,, version, releaseDate, changelogFile] = process.argv;
if (!version || !releaseDate || !changelogFile) {
console.error('Usage: node update-changelog.js <version> <date> <changelog-file>');
process.exit(1);
}
const changelogContent = fs.readFileSync(changelogFile, 'utf8').trim();
// This script updates CHANGELOG.md with a new release section using the provided release notes file
// Usage: node update-changelog.js <version> <date> <release-notes-file>
const fs = require('fs');
const [,, version, releaseDate, releaseNotesFile] = process.argv;
if (!version || !releaseDate || !releaseNotesFile) {
console.error('Usage: node update-changelog.js <version> <date> <release-notes-file>');
process.exit(1);
}
const changelogContent = fs.readFileSync(releaseNotesFile, 'utf8').trim();

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +21
const newSection = `## v${version} (${releaseDate})

### Changes

${changelogContent}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

New release entries are created with a ### Changes subsection, but the existing CHANGELOG.md uses ### New / ### Fixes subsections for versioned releases. Please align the generated section headings with the established changelog structure (or update the changelog format consistently across existing entries).

Copilot uses AI. Check for mistakes.
@YunchuWang YunchuWang merged commit 5049269 into main Feb 10, 2026
16 checks passed
@YunchuWang YunchuWang deleted the wangbill/ru branch February 10, 2026 19:43
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.

3 participants