File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed
Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @changesets/action " : patch
3+ ---
4+
5+ Allow customize PR ` branch ` field
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ inputs:
2828 description : " A boolean value to indicate whether to create Github releases after `publish` or not"
2929 required : false
3030 default : true
31+ branch :
32+ description : Sets the branch in which the action will run. Default to `github.ref_name` if not provided
33+ required : false
3134outputs :
3235 published :
3336 description : A boolean value to indicate whether a publishing is happened or not
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
109109 prTitle : getOptionalInput ( "title" ) ,
110110 commitMessage : getOptionalInput ( "commit" ) ,
111111 hasPublishScript,
112+ branch : getOptionalInput ( "branch" ) ,
112113 } ) ;
113114
114115 core . setOutput ( "pullRequestNumber" , String ( pullRequestNumber ) ) ;
Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ type VersionOptions = {
299299 commitMessage ?: string ;
300300 hasPublishScript ?: boolean ;
301301 prBodyMaxCharacters ?: number ;
302+ branch ?: string ;
302303} ;
303304
304305type RunVersionResult = {
@@ -313,11 +314,12 @@ export async function runVersion({
313314 commitMessage = "Version Packages" ,
314315 hasPublishScript = false ,
315316 prBodyMaxCharacters = MAX_CHARACTERS_PER_MESSAGE ,
317+ branch,
316318} : VersionOptions ) : Promise < RunVersionResult > {
317319 const octokit = setupOctokit ( githubToken ) ;
318320
319321 let repo = `${ github . context . repo . owner } /${ github . context . repo . repo } ` ;
320- let branch = github . context . ref . replace ( "refs/heads/" , "" ) ;
322+ branch = branch ?? github . context . ref . replace ( "refs/heads/" , "" ) ;
321323 let versionBranch = `changeset-release/${ branch } ` ;
322324
323325 let { preState } = await readChangesetState ( cwd ) ;
You can’t perform that action at this time.
0 commit comments