Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customize PR branch name #370

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

cregourd
Copy link

As of previous PR #255, it's possible to trigger the Changeset Pull Request process from a branch other than baseBranch. Thanks for this, it's really useful 馃檹

If two branches want to merge into baseBranch, the PR branch name will always be changeset-release/{{baseBranch}}. In this case, the latest commit will override the branch.

But sometimes we just want two different branches. For example, in a Git workflow where the release can come from the develop branch or the hotfixes branch.

It should be possible to do this workflow with this PR

schema

Copy link

changeset-bot bot commented May 16, 2024

馃 Changeset detected

Latest commit: 813d004

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 Patch

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

Comment on lines +31 to 35
branchName:
description: Sets the branch name for the pull request. Default to `changeset-release/{{$github.ref_name}}`
required: false
branch:
description: Sets the branch in which the action will run. Default to `github.ref_name` if not provided
Copy link
Member

Choose a reason for hiding this comment

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

those 2 inputs are too close to each other

}: VersionOptions): Promise<RunVersionResult> {
const octokit = setupOctokit(githubToken);

let repo = `${github.context.repo.owner}/${github.context.repo.repo}`;
branch = branch ?? github.context.ref.replace("refs/heads/", "");
let versionBranch = `changeset-release/${branch}`;
let versionBranch = branchName ?? `changeset-release/${branch}`;
Copy link
Member

Choose a reason for hiding this comment

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

the problem with this is that we rely on changeset-release/* being the versioning branch:
https://github.com/changesets/bot/blob/492290be72c42ae8f9ba85afe636a7b4520a9909/index.ts#L138-L142

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.

None yet

2 participants