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:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
---
|
||||
|
||||
Updated publish:gitlab:merge-request action to allow commit updates and deletes
|
||||
+9
-1
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user