diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index 531fb257f3..ba7576b1bb 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -679,7 +679,16 @@ export function createPublishGitlabAction(options: { gitAuthorEmail?: string | undefined; setUserAsOwner?: boolean | undefined; topics?: string[] | undefined; - settings?: Record | undefined; + settings?: + | { + path?: string | undefined; + auto_devops_enabled?: boolean | undefined; + ci_config_path?: string | undefined; + description?: string | undefined; + topics?: string[] | undefined; + visibility?: 'internal' | 'private' | 'public' | undefined; + } + | undefined; branches?: | { name: string; diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.ts index d0886e85a3..4933ad6e69 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.ts @@ -22,11 +22,6 @@ import { initRepoAndPush, printGitlabError } from '../helpers'; import { getRepoSourceDirectory, parseRepoUrl } from './util'; import { Config } from '@backstage/config'; import { examples } from './gitlab.examples'; -import { - GitlabBranchSettings, - GitlabProjectSettings, - GitlabProjectVariableSettings, -} from './gitlab.types'; /** * Creates a new action that initializes a git repository of the content in the workspace @@ -53,9 +48,30 @@ export function createPublishGitlabAction(options: { setUserAsOwner?: boolean; /** @deprecated in favour of settings.topics field */ topics?: string[]; - settings?: GitlabProjectSettings; - branches?: Array; - projectVariables?: Array; + settings?: { + path?: string; + auto_devops_enabled?: boolean; + ci_config_path?: string; + description?: string; + topics?: string[]; + visibility?: 'private' | 'internal' | 'public'; + }; + branches?: Array<{ + name: string; + protect?: boolean; + create?: boolean; + ref?: string; + }>; + projectVariables?: Array<{ + key: string; + value: string; + description?: string; + variable_type?: string; + protected?: boolean; + masked?: boolean; + raw?: boolean; + environment_scope?: string; + }>; }>({ id: 'publish:gitlab', description: diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.types.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.types.ts deleted file mode 100644 index 0a6be3e801..0000000000 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.types.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2021 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export type GitlabProjectSettings = { - path?: string; - auto_devops_enabled?: boolean; - ci_config_path?: string; - description?: string; - topics?: string[]; - visibility?: 'private' | 'internal' | 'public'; -}; - -export type GitlabBranchSettings = { - name: string; - protect?: boolean; - create?: boolean; - ref?: string; -}; - -export type GitlabProjectVariableSettings = { - key: string; - value: string; - description?: string; - variable_type?: string; - protected?: boolean; - masked?: boolean; - raw?: boolean; - environment_scope?: string; -};