Merge pull request #20733 from alexef/allow-pr-update

fix: pass update input to createPullRequest (fixes: #17911)
This commit is contained in:
Fredrik Adelöw
2023-10-23 14:44:17 +02:00
committed by GitHub
3 changed files with 14 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': minor
---
Allow setting `update: true` in `publish:github:pull-request` scaffolder action
+1
View File
@@ -659,6 +659,7 @@ export const createPublishGithubPullRequestAction: (
reviewers?: string[] | undefined;
teamReviewers?: string[] | undefined;
commitMessage?: string | undefined;
update?: boolean | undefined;
},
JsonObject
>;
@@ -142,6 +142,7 @@ export const createPublishGithubPullRequestAction = (
reviewers?: string[];
teamReviewers?: string[];
commitMessage?: string;
update?: boolean;
}>({
id: 'publish:github:pull-request',
examples,
@@ -219,6 +220,11 @@ export const createPublishGithubPullRequestAction = (
title: 'Commit Message',
description: 'The commit message for the pull request commit',
},
update: {
type: 'boolean',
title: 'Update',
description: 'Update pull request if already exists',
},
},
},
output: {
@@ -256,6 +262,7 @@ export const createPublishGithubPullRequestAction = (
reviewers,
teamReviewers,
commitMessage,
update,
} = ctx.input;
const { owner, repo, host } = parseRepoUrl(repoUrl, integrations);
@@ -327,6 +334,7 @@ export const createPublishGithubPullRequestAction = (
body: description,
head: branchName,
draft,
update,
};
if (targetBranchName) {
createOptions.base = targetBranchName;