Add oneOf output subschema to publish:github:pull-request action

Signed-off-by: Tanner Juedeman <tbjuedeman@gmail.com>
This commit is contained in:
Tanner Juedeman
2025-02-04 14:33:30 -06:00
committed by blam
parent 1e935f0afe
commit ef21f88c6e
2 changed files with 46 additions and 17 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-github': patch
---
Added oneOf output schema to publish:github:pull-request scaffolder action to allow for non-breaking addition of createWhenEmpty option
@@ -256,29 +256,53 @@ export const createPublishGithubPullRequestAction = (
type: 'boolean',
title: 'Create When Empty',
description:
'Set whether to create pull request when there are no changes to commit. The default value is true',
'Set whether to create pull request when there are no changes to commit. The default value is true. If set to false, remoteUrl is no longer a required output.',
},
},
},
output: {
required: [],
type: 'object',
properties: {
targetBranchName: {
title: 'Target branch name of the merge request',
type: 'string',
oneOf: [
{
required: ['remoteUrl'],
type: 'object',
properties: {
targetBranchName: {
title: 'Target branch name of the merge request',
type: 'string',
},
remoteUrl: {
type: 'string',
title: 'Pull Request URL',
description: 'Link to the pull request in Github',
},
pullRequestNumber: {
type: 'number',
title: 'Pull Request Number',
description: 'The pull request number',
},
},
},
remoteUrl: {
type: 'string',
title: 'Pull Request URL',
description: 'Link to the pull request in Github',
{
required: [],
type: 'object',
properties: {
targetBranchName: {
title: 'Target branch name of the merge request',
type: 'string',
},
remoteUrl: {
type: 'string',
title: 'Pull Request URL',
description: 'Link to the pull request in Github',
},
pullRequestNumber: {
type: 'number',
title: 'Pull Request Number',
description: 'The pull request number',
},
},
},
pullRequestNumber: {
type: 'number',
title: 'Pull Request Number',
description: 'The pull request number',
},
},
],
},
},
async handler(ctx) {