Merge pull request #10407 from simongellis-attentive/draft-github-prs

Support creating draft GitHub prs
This commit is contained in:
Johan Haals
2022-03-28 13:25:32 +02:00
committed by GitHub
4 changed files with 16 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': minor
---
Add new `draft` option to the `publish:github:pull-request` action.
+1
View File
@@ -251,6 +251,7 @@ export const createPublishGithubPullRequestAction: ({
branchName: string;
description: string;
repoUrl: string;
draft?: boolean | undefined;
targetPath?: string | undefined;
sourcePath?: string | undefined;
token?: string | undefined;
@@ -85,6 +85,7 @@ describe('createPublishGithubPullRequestAction', () => {
title: 'Create my new app',
branchName: 'new-app',
description: 'This PR is really good',
draft: true,
};
mockFs({
@@ -109,6 +110,7 @@ describe('createPublishGithubPullRequestAction', () => {
title: 'Create my new app',
head: 'new-app',
body: 'This PR is really good',
draft: true,
changes: [
{
commit: 'Create my new app',
@@ -115,6 +115,7 @@ export const createPublishGithubPullRequestAction = ({
branchName: string;
description: string;
repoUrl: string;
draft?: boolean;
targetPath?: string;
sourcePath?: string;
token?: string;
@@ -145,6 +146,11 @@ export const createPublishGithubPullRequestAction = ({
title: 'Pull Request Description',
description: 'The description of the pull request',
},
draft: {
type: 'boolean',
title: 'Create as Draft',
description: 'Create a draft pull request',
},
sourcePath: {
type: 'string',
title: 'Working Subdirectory',
@@ -186,6 +192,7 @@ export const createPublishGithubPullRequestAction = ({
branchName,
title,
description,
draft,
targetPath,
sourcePath,
token: providedToken,
@@ -264,6 +271,7 @@ export const createPublishGithubPullRequestAction = ({
changes,
body: description,
head: branchName,
draft,
});
if (!response) {