Skip to content

fix: extract publish logic to dedicated release script#5

Merged
eli0shin merged 1 commit intomainfrom
fix-publish-script
Dec 4, 2025
Merged

fix: extract publish logic to dedicated release script#5
eli0shin merged 1 commit intomainfrom
fix-publish-script

Conversation

@eli0shin
Copy link
Owner

@eli0shin eli0shin commented Dec 4, 2025

Summary

  • Extract multi-line publish logic from version.yml workflow to dedicated scripts/release.sh
  • Fix changesets action compatibility issue with multi-line shell scripts

Problem

The changesets action's publish field doesn't properly support multi-line shell scripts. When a multi-line script is provided, the action attempts to execute only the first line as a command name, causing the workflow to fail.

Solution

Created scripts/release.sh to contain the version check and publish logic, and updated version.yml to call it with bash scripts/release.sh. This approach:

  • Maintains the existing version check behavior (only publishes if version doesn't exist on npm)
  • Works within the constraints of the changesets action's publish field
  • Improves maintainability by separating the release logic into a dedicated script

🤖 Generated with Claude Code

The changesets action's publish field doesn't properly support multi-line
shell scripts. This change extracts the version check and publish logic
to a dedicated scripts/release.sh file, improving maintainability and
ensuring the workflow executes correctly.

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2025

⚠️ No Changeset found

Latest commit: 1633417

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@eli0shin eli0shin marked this pull request as ready for review December 4, 2025 13:33
Copilot AI review requested due to automatic review settings December 4, 2025 13:33
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

This PR extracts the npm publishing logic from the GitHub Actions workflow into a dedicated bash script to work around a compatibility issue with the changesets action's handling of multi-line shell commands.

Key Changes:

  • Created scripts/release.sh containing version check and conditional publish logic
  • Updated workflow to call the script with bash scripts/release.sh instead of inline multi-line commands

Reviewed changes

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

File Description
scripts/release.sh New bash script that checks if a version exists on npm before publishing, extracted from the workflow
.github/workflows/version.yml Updated to call the new release script instead of using inline multi-line shell commands

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

@eli0shin eli0shin merged commit 8197b5f into main Dec 4, 2025
8 checks passed
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.

1 participant