Skip to content

chore: enable automatic CHANGELOG generation via Changesets#945

Open
kdaviduik wants to merge 2 commits intomainfrom
enable-auto-changelog
Open

chore: enable automatic CHANGELOG generation via Changesets#945
kdaviduik wants to merge 2 commits intomainfrom
enable-auto-changelog

Conversation

@kdaviduik
Copy link
Copy Markdown
Contributor

@kdaviduik kdaviduik commented Mar 9, 2026

Part of https://github.com/Shopify/developer-tools-team/issues/1195


Switch from manual CHANGELOG management to @changesets/changelog-github.

  • Update .changeset/config.json to use @changesets/changelog-github
  • Pass GITHUB_TOKEN to changeset version step in release workflow
    (@changesets/changelog-github needs it to fetch PR metadata for links)
  • Fix git add to include CHANGELOG.md (pre-existing bug — changeset version
    modifies CHANGELOG.md but it was never staged in the commit step)
  • Fix stale v3.0.6 '(Unreleased)' label — published to npm August 25, 2025

Verification

Smoke-tested the CHANGELOG automation locally:

  1. Created a temporary test changeset (@shopify/buy-button-js: patch)
  2. Ran GITHUB_TOKEN=$(gh auth token) pnpm exec changeset version
  3. Confirmed CHANGELOG.md was updated with a new ## 3.0.7 section containing the test entry
  4. Reverted all changes (git checkout -- package.json CHANGELOG.md && rm .changeset/test-changelog-automation.md)

Result: changeset version exits 0, plugin loads correctly, and CHANGELOG.md is generated with proper formatting.

@kdaviduik kdaviduik force-pushed the enable-auto-changelog branch from f2a1c65 to b8b74d9 Compare March 10, 2026 01:37
@kdaviduik kdaviduik force-pushed the 03-09-feat_migrate_yarn_v1_to_pnpm branch from a65405e to 12b544b Compare March 10, 2026 01:37
Base automatically changed from 03-09-feat_migrate_yarn_v1_to_pnpm to main March 12, 2026 14:16
@kdaviduik kdaviduik marked this pull request as ready for review March 12, 2026 19:20
@kdaviduik kdaviduik requested a review from a team as a code owner March 12, 2026 19:20
Switch from manual CHANGELOG management to @changesets/changelog-github.
- Update .changeset/config.json to use @changesets/changelog-github
- Pass GITHUB_TOKEN to changeset version step in release workflow
  (@changesets/changelog-github needs it to fetch PR metadata for links)
- Fix git add to include CHANGELOG.md (pre-existing bug — changeset version
  modifies CHANGELOG.md but it was never staged in the commit step)
- Fix stale v3.0.6 '(Unreleased)' label — published to npm August 25, 2025
…ELOG date

Two items from the PR 4a plan that were missed in the original commit:

1. @changesets/changelog-github was referenced in .changeset/config.json
   but never declared in package.json devDependencies. The lockfile had
   the specifier (from pnpm install), so CI's --frozen-lockfile saw a
   mismatch and failed.

2. CHANGELOG.md v3.0.6 date was still "(Unreleased)" — v3.0.6 was
   published to npm on August 25, 2025.
Copy link
Copy Markdown

@fredericoo fredericoo left a comment

Choose a reason for hiding this comment

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

lgtm!

git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add package.json .changeset
git add package.json .changeset CHANGELOG.md
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

praise: good catch - changeset version was already generating CHANGELOG.md updates, but they were never staged in the commit step. this was a silent bug.

git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add package.json .changeset
git add package.json .changeset CHANGELOG.md
git commit -m "Update package version & delete changesets"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: the commit message says "Update package version & delete changesets" but now it also commits CHANGELOG.md changes. might be worth updating to reflect that - something like "Update package version, changelog & delete changesets". not fussed either way though.

Suggested change
git commit -m "Update package version & delete changesets"
git commit -m "Update package version, changelog & delete changesets"

Comment thread package.json
"@babel/plugin-transform-template-literals": "7.4.4",
"@babel/plugin-transform-typeof-symbol": "7.2.0",
"@babel/preset-typescript": "^7.27.1",
"@changesets/changelog-github": "^0.6.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

non-blocking: @changesets/changelog-github pulls in node-fetch, dataloader, and dotenv as transitive deps. this is fine for a devDependency that only runs in CI, but worth noting - dotenv reads .env files from the working directory, so if one ever gets added to the repo it could affect the changeset version step. low risk, just flagging for awareness.

Comment thread CHANGELOG.md
@@ -1,5 +1,5 @@
# Changelog
### v3.0.6 (Unreleased)
### v3.0.6 (August 25, 2025)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

praise: cheers for fixing the stale "(Unreleased)" label - v3.0.6 has been on npm since August.

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