Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 11 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ permissions:
jobs:
release:
name: Release
if: "!contains(github.event.head_commit.message, 'ci: changeset release')"
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
Expand All @@ -30,7 +29,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: true # release job pushes version changes
persist-credentials: true # changesets/action pushes Version PR commits
- name: Check for changesets
id: changesets
run: |
Expand All @@ -54,24 +53,7 @@ jobs:
- name: Enter Pre-Release Mode
if: "contains(github.ref_name, '-pre') && !hashFiles('.changeset/pre.json')"
run: pnpm changeset pre enter pre
- name: Version Packages
run: pnpm run changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and Push Version Changes
id: commit
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
if git commit -m "ci: changeset release"; then
git push origin "HEAD:${GITHUB_REF_NAME}"
echo "committed=true" >> "$GITHUB_OUTPUT"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Determine dist-tag
if: steps.commit.outputs.committed == 'true'
id: dist-tag
run: |
BRANCH="${GITHUB_REF_NAME}"
Expand All @@ -82,13 +64,18 @@ jobs:
else
echo "latest=true" >> "$GITHUB_OUTPUT"
fi
- name: Publish Packages
if: steps.commit.outputs.committed == 'true'
run: pnpm run changeset:publish ${DIST_TAG_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) }}
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}
Comment on lines +67 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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:


🌐 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:


🏁 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 || true

Repository: TanStack/intent

Length of output: 4413


Disable changesets/action GitHub release creation to avoid double release creation.

  • changesets/action creates GitHub releases by default (createGithubReleases defaults to true), and this workflow doesn’t override it.
  • The workflow separately runs node scripts/create-github-release.mjs when steps.changesets-action.outputs.published == 'true'; that script calls gh 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.

Suggested change
- 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.

env:
PRERELEASE_ARG: ${{ steps.dist-tag.outputs.prerelease == 'true' && '--prerelease' }}
Expand Down
Loading