Merge pull request #24580 from kenzliang/patch-2

Add additional Gitlab project settings
This commit is contained in:
Ben Lambert
2024-05-06 15:55:14 +02:00
committed by GitHub
4 changed files with 47 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-gitlab': patch
---
Add merge method and squash option for project creation
@@ -145,6 +145,13 @@ export function createPublishGitlabAction(options: {
auto_devops_enabled?: boolean | undefined;
ci_config_path?: string | undefined;
description?: string | undefined;
merge_method?: 'merge' | 'ff' | 'rebase_merge' | undefined;
squash_option?:
| 'always'
| 'never'
| 'default_on'
| 'default_off'
| undefined;
topics?: string[] | undefined;
visibility?: 'internal' | 'private' | 'public' | undefined;
}
@@ -87,6 +87,26 @@ export const examples: TemplateExample[] = [
],
}),
},
{
description:
'Initializes a GitLab repository with fast forward merge and always squash settings.',
example: yaml.stringify({
steps: [
{
id: 'publish',
action: 'publish:gitlab',
name: 'Publish to GitLab',
input: {
repoUrl: 'gitlab.com?repo=project_name&owner=group_name',
settings: {
merge_method: 'ff',
squash_option: 'always',
},
},
},
],
}),
},
{
description: 'Initializes a GitLab repository with branch settings.',
example: yaml.stringify({
@@ -56,6 +56,8 @@ export function createPublishGitlabAction(options: {
auto_devops_enabled?: boolean;
ci_config_path?: string;
description?: string;
merge_method?: 'merge' | 'rebase_merge' | 'ff';
squash_option?: 'default_off' | 'default_on' | 'never' | 'always';
topics?: string[];
visibility?: 'private' | 'internal' | 'public';
};
@@ -169,6 +171,19 @@ export function createPublishGitlabAction(options: {
description: 'Short project description',
type: 'string',
},
merge_method: {
title: 'Merge Method to use',
description: 'Merge Methods (merge, rebase_merge, ff)',
type: 'string',
enum: ['merge', 'rebase_merge', 'ff'],
},
squash_option: {
title: 'Squash option',
description:
'Set squash option for the project (never, always, default_on, default_off)',
type: 'string',
enum: ['default_off', 'default_on', 'never', 'always'],
},
topics: {
title: 'Topic labels',
description: 'Topic labels to apply on the repository',