Merge pull request #14310 from cctechwiz/feature/add-topics-to-scaffolded-gitlab-repo
Adding optional string array of topics to publish gitlab action
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': minor
|
||||
---
|
||||
|
||||
Adds the ability to pass (an optional) array of strings that will be applied to the newly scaffolded repository as topic labels.
|
||||
@@ -443,6 +443,7 @@ export function createPublishGitlabAction(options: {
|
||||
gitAuthorName?: string | undefined;
|
||||
gitAuthorEmail?: string | undefined;
|
||||
setUserAsOwner?: boolean | undefined;
|
||||
topics?: string[] | undefined;
|
||||
}>;
|
||||
|
||||
// @public
|
||||
|
||||
@@ -44,6 +44,7 @@ export function createPublishGitlabAction(options: {
|
||||
gitAuthorName?: string;
|
||||
gitAuthorEmail?: string;
|
||||
setUserAsOwner?: boolean;
|
||||
topics?: string[];
|
||||
}>({
|
||||
id: 'publish:gitlab',
|
||||
description:
|
||||
@@ -99,6 +100,14 @@ export function createPublishGitlabAction(options: {
|
||||
description:
|
||||
'Set the token user as owner of the newly created repository. Requires a token authorized to do the edit in the integration configuration for the matching host',
|
||||
},
|
||||
topics: {
|
||||
title: 'Topic labels',
|
||||
description: 'Topic labels to apply on the repository.',
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
output: {
|
||||
@@ -128,6 +137,7 @@ export function createPublishGitlabAction(options: {
|
||||
gitAuthorName,
|
||||
gitAuthorEmail,
|
||||
setUserAsOwner = false,
|
||||
topics = [],
|
||||
} = ctx.input;
|
||||
const { owner, repo, host } = parseRepoUrl(repoUrl, integrations);
|
||||
|
||||
@@ -173,6 +183,7 @@ export function createPublishGitlabAction(options: {
|
||||
namespace_id: targetNamespace,
|
||||
name: repo,
|
||||
visibility: repoVisibility,
|
||||
...(topics.length ? { topics } : {}),
|
||||
});
|
||||
|
||||
// When setUserAsOwner is true the input token is expected to come from an unprivileged user GitLab
|
||||
|
||||
Reference in New Issue
Block a user