File tree 4 files changed +12
-1
lines changed
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:
28
28
description : " A boolean value to indicate whether to create Github releases after `publish` or not"
29
29
required : false
30
30
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
31
34
outputs :
32
35
published :
33
36
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;
109
109
prTitle : getOptionalInput ( "title" ) ,
110
110
commitMessage : getOptionalInput ( "commit" ) ,
111
111
hasPublishScript,
112
+ branch : getOptionalInput ( "branch" ) ,
112
113
} ) ;
113
114
114
115
core . setOutput ( "pullRequestNumber" , String ( pullRequestNumber ) ) ;
Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ type VersionOptions = {
299
299
commitMessage ?: string ;
300
300
hasPublishScript ?: boolean ;
301
301
prBodyMaxCharacters ?: number ;
302
+ branch ?: string ;
302
303
} ;
303
304
304
305
type RunVersionResult = {
@@ -313,11 +314,12 @@ export async function runVersion({
313
314
commitMessage = "Version Packages" ,
314
315
hasPublishScript = false ,
315
316
prBodyMaxCharacters = MAX_CHARACTERS_PER_MESSAGE ,
317
+ branch,
316
318
} : VersionOptions ) : Promise < RunVersionResult > {
317
319
const octokit = setupOctokit ( githubToken ) ;
318
320
319
321
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/" , "" ) ;
321
323
let versionBranch = `changeset-release/${ branch } ` ;
322
324
323
325
let { preState } = await readChangesetState ( cwd ) ;
You can’t perform that action at this time.
0 commit comments