diff --git a/.changeset/thick-readers-invite.md b/.changeset/thick-readers-invite.md new file mode 100644 index 0000000000..3da406ff05 --- /dev/null +++ b/.changeset/thick-readers-invite.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Updated publish:gitlab:merge-request action to allow commit updates and deletes diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlabMergeRequest.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlabMergeRequest.ts index f717a7a0c6..17026cc895 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlabMergeRequest.ts @@ -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'),