use changesets/action PR flow for releases#149
Conversation
📝 WalkthroughWalkthroughThe release GitHub Actions workflow migrates from manual versioning and commit-based publishing to automated changesets action. The job-level guard preventing runs on ChangesRelease Workflow Changesets Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit f2d3223
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 67-79: The changesets/action step (id: changesets-action, uses:
changesets/action) is creating GitHub releases by default and duplicates the
separate release script; add the action input createGithubReleases set to false
in the same with: block (e.g., add createGithubReleases: 'false') so
changesets/action will not create releases and only node
scripts/create-github-release.mjs runs.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: ad699f55-58c1-4058-9a85-5b0f3e87a9d4
📒 Files selected for processing (1)
.github/workflows/release.yml
| - name: Create Release Pull Request or Publish | ||
| id: changesets-action | ||
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0 | ||
| with: | ||
| version: pnpm run changeset:version | ||
| publish: pnpm run changeset:publish ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }} | ||
| title: 'ci: Version Packages' | ||
| commit: 'ci: changeset release' | ||
| env: | ||
| DIST_TAG_ARG: ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Create GitHub Release | ||
| if: steps.commit.outputs.committed == 'true' | ||
| if: steps.changesets-action.outputs.published == 'true' | ||
| run: node scripts/create-github-release.mjs ${PRERELEASE_ARG} ${LATEST_ARG} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the relevant workflow section around the referenced lines
echo "=== .github/workflows/release.yml (lines ~50-110) ==="
nl -ba .github/workflows/release.yml | sed -n '45,115p'
# Show how changesets-action outputs are used elsewhere in the workflow
echo
echo "=== Search for changesets-action outputs usage in release.yml ==="
rg -n "changesets-action|create-github-release|published" .github/workflows/release.yml
# Inspect the create-github-release script to confirm what it does
echo
echo "=== scripts/create-github-release.mjs (lines ~1-220) ==="
nl -ba scripts/create-github-release.mjs | sed -n '1,220p'
# Find the part that creates the GitHub Release (octokit usage / createRelease etc.)
echo
echo "=== Search in create-github-release.mjs for release creation ==="
rg -n "create.*release|releases|octokit|createRelease|POST.*releases|tag_name" scripts/create-github-release.mjs
# Also check if the script is only invoked from this workflow
echo
echo "=== Search repo for create-github-release.mjs invocations ==="
rg -n "scripts/create-github-release\.mjs" .Repository: TanStack/intent
Length of output: 174
🌐 Web query:
changesets/action createGithubReleases default value behavior
💡 Result:
The createGithubReleases option in the changesets/action is a boolean configuration that determines whether the action will automatically create GitHub releases after a successful publish [1][2]. Its default value is true [1][3]. Key behavioral details include: Automatic Release Creation: When set to its default (true), the action attempts to create a GitHub release following a successful publish event [1][2]. This functionality relies on the publish process to provide the necessary context (e.g., package versions) [4]. Dependency on Publish: The createGithubReleases logic is triggered in conjunction with the publish command [4]. If the action is not configured to publish—or if the publish step does not successfully complete—the GitHub release creation may not occur as expected [4][5]. Permissions: For this feature to function correctly, the workflow requires appropriate permissions, typically configured via GITHUB_TOKEN or a Personal Access Token (PAT) with read-write access to the repository's contents [5]. Behavior when Disabled: When explicitly set to false, the action does not create GitHub releases [1][6]. Users have reported that this setting may also affect git tag behavior, as the action's ability to push tags can be tied to the release creation logic [6].
Citations:
- 1: https://github.com/changesets/action/blob/main/README.md
- 2: https://github.com/marketplace/actions/changesets
- 3: https://github.com/changesets/action?tab=readme-ov-file
- 4: Make it possible to create a GH release without publishing! changesets/action#422
- 5: Changesets GithubAction not creating github releases changesets/changesets#1202
- 6:
createGithubReleases: falsedisables git tag pushes too which is undocumented changesets/action#547
🌐 Web query:
changesets/action outputs published createGithubReleases
💡 Result:
The createGithubReleases input in the official changesets/action is a boolean option used to control whether GitHub releases are automatically created after the publish process completes [1][2][3]. Key details regarding this option include: Default Behavior: The option defaults to true, meaning the action will attempt to create a GitHub release automatically whenever a package is published [1][2][3]. Configuration: To use it, you include it in the with block of your workflow configuration for changesets/action [1][4]. Prerequisites: For GitHub releases to be created, you must ensure that your GitHub Actions workflow has the appropriate permissions (usually by providing the GITHUB_TOKEN in the environment section of the step) [4][5]. If you are using the official changesets/action, it performs this task automatically by default [1][3]. If you require more advanced options—such as aggregating multiple releases into a single GitHub release—you may need to look at community-maintained forks like dotansimha/changesets-action, which offer extended configurations for this setting [5].
Citations:
- 1: https://github.com/changesets/action/blob/main/README.md
- 2: https://github.com/changesets/action?tab=readme-ov-file
- 3: https://github.com/changesets/action/tree/refs/heads/main
- 4: https://github.com/marketplace/actions/changesets-gh
- 5: https://github.com/dotansimha/changesets-action
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== .github/workflows/release.yml (lines 55-110) ==="
awk 'NR>=55 && NR<=110 {printf "%5d:%s\n", NR, $0}' .github/workflows/release.yml
echo
echo "=== Search for create-github-release invocation in release.yml ==="
rg -n "create-github-release\.mjs|steps\.changesets-action\.outputs\.published|changesets/action" .github/workflows/release.yml
echo
echo "=== scripts/create-github-release.mjs (first 220 lines) ==="
awk 'NR>=1 && NR<=220 {printf "%5d:%s\n", NR, $0}' scripts/create-github-release.mjs
echo
echo "=== Search for GitHub release creation in create-github-release.mjs ==="
rg -n "createRelease|repos\.create|POST .*releases|releases|tag_name|octokit" scripts/create-github-release.mjs
echo
echo "=== Search repo for scripts/create-github-release.mjs invocations ==="
rg -n "scripts/create-github-release\.mjs" .Repository: TanStack/intent
Length of output: 9125
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== scripts/create-github-release.mjs (lines 200-520) ==="
awk 'NR>=200 && NR<=520 {printf "%5d:%s\n", NR, $0}' scripts/create-github-release.mjs
echo
echo "=== Search for GitHub API release creation calls ==="
rg -n "createRelease|repos\\..*releases|releases\\.create|POST .*releases|octokit|actions\\.github|`@octokit`|gh api" scripts/create-github-release.mjs || true
echo
echo "=== Search for createGithubReleases or changesets-action inputs in repo ==="
rg -n "createGithubReleases" .github/workflows scripts || true
echo
echo "=== Search for any other steps that run create-github-release.mjs ==="
rg -n "node scripts/create-github-release\\.mjs" .github/workflows || trueRepository: TanStack/intent
Length of output: 4413
Disable changesets/action GitHub release creation to avoid double release creation.
changesets/actioncreates GitHub releases by default (createGithubReleasesdefaults totrue), and this workflow doesn’t override it.- The workflow separately runs
node scripts/create-github-release.mjswhensteps.changesets-action.outputs.published == 'true'; that script callsgh release create, so the same publish run can attempt to create a release twice (leading to duplicate releases or failures).
Suggested fix
- name: Create Release Pull Request or Publish
id: changesets-action
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
with:
version: pnpm run changeset:version
publish: pnpm run changeset:publish ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }}
+ createGithubReleases: false
title: 'ci: Version Packages'
commit: 'ci: changeset release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Create Release Pull Request or Publish | |
| id: changesets-action | |
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0 | |
| with: | |
| version: pnpm run changeset:version | |
| publish: pnpm run changeset:publish ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }} | |
| title: 'ci: Version Packages' | |
| commit: 'ci: changeset release' | |
| env: | |
| DIST_TAG_ARG: ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| if: steps.commit.outputs.committed == 'true' | |
| if: steps.changesets-action.outputs.published == 'true' | |
| run: node scripts/create-github-release.mjs ${PRERELEASE_ARG} ${LATEST_ARG} | |
| - name: Create Release Pull Request or Publish | |
| id: changesets-action | |
| uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0 | |
| with: | |
| version: pnpm run changeset:version | |
| publish: pnpm run changeset:publish ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }} | |
| createGithubReleases: false | |
| title: 'ci: Version Packages' | |
| commit: 'ci: changeset release' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| if: steps.changesets-action.outputs.published == 'true' | |
| run: node scripts/create-github-release.mjs ${PRERELEASE_ARG} ${LATEST_ARG} |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/release.yml around lines 67 - 79, The changesets/action
step (id: changesets-action, uses: changesets/action) is creating GitHub
releases by default and duplicates the separate release script; add the action
input createGithubReleases set to false in the same with: block (e.g., add
createGithubReleases: 'false') so changesets/action will not create releases and
only node scripts/create-github-release.mjs runs.
Update pr workflow
Summary by CodeRabbit