File tree Expand file tree Collapse file tree 4 files changed +11
-0
lines changed
Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' changesets-gitlab ' : minor
3+ ---
4+
5+ feat: added new input variable controling if the source branch should be automatically deleted or not
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ GitLab CI cli for [changesets](https://github.com/atlassian/changesets) like its
2828
2929- published - Command executed after published
3030- only_changesets - Command executed on only changesets detected
31+ - remove_source_branch - Enables the merge request "Delete source branch" checkbox. Default false.
3132- target_branch -> The merge request target branch. Defaults to current branch
3233
3334### Outputs
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ export const main = async ({
105105 mrTitle : getOptionalInput ( 'title' ) ,
106106 mrTargetBranch : getOptionalInput ( 'target_branch' ) ,
107107 commitMessage : getOptionalInput ( 'commit' ) ,
108+ removeSourceBranch : getInput ( 'remove_source_branch' ) === 'true' ,
108109 hasPublishScript,
109110 } )
110111 if ( onlyChangesets ) {
Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ interface VersionOptions {
185185 gitlabToken : string
186186 cwd ?: string
187187 mrTitle ?: string
188+ removeSourceBranch ?: boolean
188189 mrTargetBranch ?: string
189190 commitMessage ?: string
190191 hasPublishScript ?: boolean
@@ -197,6 +198,7 @@ export async function runVersion({
197198 mrTitle = 'Version Packages' ,
198199 mrTargetBranch = context . ref ,
199200 commitMessage = 'Version Packages' ,
201+ removeSourceBranch = false ,
200202 hasPublishScript = false ,
201203} : VersionOptions ) {
202204 const currentBranch = context . ref
305307 finalMrTitle ,
306308 {
307309 description : await mrBodyPromise ,
310+ removeSourceBranch,
308311 } ,
309312 )
310313 } else {
311314 console . log ( `updating found merge request !${ searchResult [ 0 ] . iid } ` )
312315 await api . MergeRequests . edit ( context . projectId , searchResult [ 0 ] . iid , {
313316 title : finalMrTitle ,
314317 description : await mrBodyPromise ,
318+ removeSourceBranch,
315319 } )
316320 }
317321}
You can’t perform that action at this time.
0 commit comments