feat(envd): automate version bumps with changesets#2973
Conversation
Replace the manual pkg/version.go bump rule with a changesets-based release flow. PRs touching packages/envd must add a changeset (npx changeset); on merge to main, the envd-release workflow consumes pending changesets, bumps package.json and pkg/version.go (via scripts/sync-envd-version.sh), updates CHANGELOG.md, and commits the release back to main using the autofixer app. A new PR check enforces that envd changes include a changeset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit fb2e839. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Code Review
The version validation and replacement regexes in scripts/sync-envd-version.sh do not support semver prerelease tags or build metadata, which can cause the script to fail when validating prerelease versions or locating the version constant in the Go file. Updating these regexes to allow optional prerelease suffixes ensures compatibility with all valid semver formats and prevents release blockages.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "❌ Unexpected version '$version' in $package_json" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! grep -qE 'const Version = "[0-9]+\.[0-9]+\.[0-9]+"' "$version_go"; then | ||
| echo "❌ Could not find 'const Version = \"X.Y.Z\"' in $version_go" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| sed -E -i.bak "s/const Version = \"[0-9]+\.[0-9]+\.[0-9]+\"/const Version = \"$version\"/" "$version_go" |
There was a problem hiding this comment.
The version validation and replacement regexes do not support semver prerelease tags or build metadata, which are standard features of changesets. If a prerelease version like 0.6.3-beta.0 is generated, the script will fail to validate the version or locate the constant in the Go file, blocking the release process. Updating the regexes to allow optional prerelease suffixes ensures compatibility with all valid semver formats.
| if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "❌ Unexpected version '$version' in $package_json" >&2 | |
| exit 1 | |
| fi | |
| if ! grep -qE 'const Version = "[0-9]+\.[0-9]+\.[0-9]+"' "$version_go"; then | |
| echo "❌ Could not find 'const Version = \"X.Y.Z\"' in $version_go" >&2 | |
| exit 1 | |
| fi | |
| sed -E -i.bak "s/const Version = \"[0-9]+\.[0-9]+\.[0-9]+\"/const Version = \"$version\"/" "$version_go" | |
| if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then | |
| echo "❌ Unexpected version '$version' in $package_json" >&2 | |
| exit 1 | |
| fi | |
| if ! grep -qE 'const Version = "[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?"' "$version_go"; then | |
| echo "❌ Could not find 'const Version = \"X.Y.Z\"' in $version_go" >&2 | |
| exit 1 | |
| fi | |
| sed -E -i.bak "s/const Version = \"[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?\"/const Version = \"$version\"/" "$version_go" |
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: HIGH
This workflow runs npm ci after actions/checkout authenticated with a write-capable GitHub App token. Because checkout persists credentials by default, install-time lifecycle scripts from dependencies can read and exfiltrate that token.
Impact: a malicious dependency script can reuse the token to push unauthorized commits to main with the app's branch-protection bypass privileges.
Reviewed by Cursor Security Reviewer for commit fb2e839. Configure here.
❌ 2 Tests Failed:
View the top 1 failed test(s) by shortest run time
View the full list of 2 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |


Description
Replaces the manual
pkg/version.gobump rule with a changesets-based release flow, using plain npm and a small shell script to sync the version into Go.packages/envd/must now include a changeset (npx changeset, ornpx changeset --emptyfor changes that can't affect the compiled binary) — enforced by a newenvd-changesetPR check.envd-releaseworkflow runsnpx changeset version, syncs the bumped version frompackages/envd/package.jsonintopkg/version.goviascripts/sync-envd-version.sh, updatespackages/envd/CHANGELOG.md, and commits the release back to main with the autofixer app.package.json+packages/envd/package.json) whose only purpose is to give changesets a version to manage; docs updated inCLAUDE.md,packages/envd/README.md, and.changeset/README.md.Note: the autofixer GitHub App needs permission to push to
main(branch-protection bypass) for the release commit to land.🤖 Generated with Claude Code