Skip to content

Conversation

@ryanwilsonperkin
Copy link

@ryanwilsonperkin ryanwilsonperkin commented Jul 16, 2025

Fixes #184
Follow up to stale PR #370 with a slightly different approach.

Adds input prBranchSuffix

This feature allows the user to customize the suffix of the branch name that gets created for the versioning Pull Request. By default this would otherwise be changeset-release/${{ github.ref_name }}, but this doesn't work well for monorepos that have multiple uses of changesets/action within them, which would otherwise overwrite each other when pushing to changeset-release/main. With this change, monorepo users can have multiple workflows that specify different suffixes so that multiple versioning pull requests can be opened simultaneously.

For example:

# .github/workflows/version-foo.yml
on:
  push:
    branches: [main]
    paths: [foo/packages/**]
jobs:
  changesets:
    steps:
      - name: Version
        uses: changesets/action
        with:
          cwd: foo/packages
          title: Version foo
          prBranchSuffix: foo
          
# .github/workflows/version-bar.yml
on:
  push:
    branches: [main]
    paths: [bar/packages/**]
jobs:
  changesets:
    steps:
      - name: Version
        uses: changesets/action
        with:
          cwd: bar/packages
          title: Version bar
          prBranchSuffix: bar

I've attempted to address the feedback that had been left on the previous PR, and sought a route that uses a "suffix" approach instead of overriding the changeset-release/* prefixing.

@changeset-bot
Copy link

changeset-bot bot commented Jul 16, 2025

🦋 Changeset detected

Latest commit: b7d24f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/action Minor

Not sure what this means? Click here to learn what changesets are.

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

@ryanwilsonperkin
Copy link
Author

cc @cregourd, I'm following up on your previous PR
cc @Andarist, if you're available I'd appreciate your feedback on this

- createGithubReleases - A boolean value to indicate whether to create Github releases after `publish` or not. Default to `true`
- commitMode - Specifies the commit mode. Use `"git-cli"` to push changes using the Git CLI, or `"github-api"` to push changes via the GitHub API. When using `"github-api"`, all commits and tags are GPG-signed and attributed to the user or app who owns the `GITHUB_TOKEN`. Default to `git-cli`.
- cwd - Changes node's `process.cwd()` if the project is not located on the root. Default to `process.cwd()`
- branch - Sets the branch in which the action will run. Default to `github.ref_name`
Copy link
Author

Choose a reason for hiding this comment

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

Docs on this input were missing so I've added them along with the new input

ryanwilsonperkin added a commit to Shopify/snapit that referenced this pull request Jul 17, 2025
We're working on adding support for custom changeset-release/ branch suffixes so that we can handle multi-library monorepos changesets/action#513
@hariria
Copy link

hariria commented Sep 23, 2025

Can we merge this? I would also like this

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.

Custom git branch name

3 participants