Updated publish:gitlab:merge-request action to allow commit updates and deletes

Signed-off-by: Lilly Holden <lholden@adaptavist.com>
This commit is contained in:
Lilly Holden
2022-06-16 12:32:52 +01:00
parent 2bb51571de
commit eeff5046ae
2 changed files with 14 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Updated publish:gitlab:merge-request action to allow commit updates and deletes
@@ -40,6 +40,7 @@ export const createPublishGitlabMergeRequestAction = (options: {
branchName: string;
targetPath: string;
token?: string;
commitAction?: 'create' | 'delete' | 'update';
/** @deprecated Use projectPath instead */
projectid?: string;
}>({
@@ -85,6 +86,13 @@ export const createPublishGitlabMergeRequestAction = (options: {
type: 'string',
description: 'The token to use for authorization to GitLab',
},
commitAction: {
title: 'Commit action',
type: 'string',
enum: ['create', 'update', 'delete'],
description:
'The action to be used for git commit. Defaults to create.',
},
},
},
output: {
@@ -148,7 +156,7 @@ export const createPublishGitlabMergeRequestAction = (options: {
});
const actions: Types.CommitAction[] = fileContents.map(file => ({
action: 'create',
action: ctx.input.commitAction ?? 'create',
filePath: path.posix.join(ctx.input.targetPath, file.path),
encoding: 'base64',
content: file.content.toString('base64'),