Update GitLab MR Action to allow source branch to be deleted on merge

Signed-off-by: Aisha Saini <asaini1@jaguarlandrover.com>
Signed-off-by: asaini1 <asaini1@jaguarlandrover.com>
This commit is contained in:
Aisha Saini
2022-05-03 15:40:24 +01:00
committed by asaini1
parent 43bf3ae171
commit 4baf8a4ece
2 changed files with 16 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': minor
---
Update GitLab Merge Request Action to allow source branch to be deleted
@@ -42,6 +42,7 @@ export const createPublishGitlabMergeRequestAction = (options: {
token?: string;
/** @deprecated Use projectPath instead */
projectid?: string;
removeSourceBranch?: boolean;
}>({
id: 'publish:gitlab:merge-request',
schema: {
@@ -85,6 +86,12 @@ export const createPublishGitlabMergeRequestAction = (options: {
type: 'string',
description: 'The token to use for authorization to GitLab',
},
removeSourceBranch: {
title: 'Delete source branch',
type: 'boolean',
description:
'Option to delete source branch once the MR has been merged. Default: false',
},
},
},
output: {
@@ -187,7 +194,10 @@ export const createPublishGitlabMergeRequestAction = (options: {
destinationBranch,
String(defaultBranch),
ctx.input.title,
{ description: ctx.input.description },
{
description: ctx.input.description,
removeSourceBranch: ctx.input.removeSourceBranch,
},
).then((mergeRequest: { web_url: string }) => {
return mergeRequest.web_url;
});