Merge pull request #27093 from oleksiypavlenko/master

feat: Additional project settings related to MR discussions and pipelines
This commit is contained in:
Ben Lambert
2024-11-12 14:13:11 -07:00
committed by GitHub
3 changed files with 65 additions and 0 deletions
@@ -154,6 +154,11 @@ export function createPublishGitlabAction(options: {
| undefined;
topics?: string[] | undefined;
visibility?: 'internal' | 'private' | 'public' | undefined;
only_allow_merge_if_all_discussions_are_resolved?:
| boolean
| undefined;
only_allow_merge_if_pipeline_succeeds?: boolean | undefined;
allow_merge_on_skipped_pipeline?: boolean | undefined;
}
| undefined;
branches?:
@@ -163,4 +163,43 @@ export const examples: TemplateExample[] = [
],
}),
},
{
description:
'Initializes a GitLab repository with pipeline must succeed and allow merge on skipped pipeline 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: {
only_allow_merge_if_pipeline_succeeds: true,
allow_merge_on_skipped_pipeline: true,
},
},
},
],
}),
},
{
description:
'Initializes a GitLab repository with setting to require all threads (discussions) on merge request to be resolved before merging.',
example: yaml.stringify({
steps: [
{
id: 'publish',
action: 'publish:gitlab',
name: 'Publish to GitLab',
input: {
repoUrl: 'gitlab.com?repo=project_name&owner=group_name',
settings: {
only_allow_merge_if_all_discussions_are_resolved: true,
},
},
},
],
}),
},
];
@@ -60,6 +60,9 @@ export function createPublishGitlabAction(options: {
squash_option?: 'default_off' | 'default_on' | 'never' | 'always';
topics?: string[];
visibility?: 'private' | 'internal' | 'public';
only_allow_merge_if_all_discussions_are_resolved?: boolean;
only_allow_merge_if_pipeline_succeeds?: boolean;
allow_merge_on_skipped_pipeline?: boolean;
};
branches?: Array<{
name: string;
@@ -199,6 +202,24 @@ export function createPublishGitlabAction(options: {
type: 'string',
enum: ['private', 'public', 'internal'],
},
only_allow_merge_if_all_discussions_are_resolved: {
title: 'All threads must be resolved',
description:
'Set whether merge requests can only be merged when all the discussions are resolved.',
type: 'boolean',
},
only_allow_merge_if_pipeline_succeeds: {
title: 'Pipelines must succeed',
description:
'Set whether merge requests can only be merged with successful pipelines. This setting is named Pipelines must succeed in the project settings.',
type: 'boolean',
},
allow_merge_on_skipped_pipeline: {
title: 'Skipped pipelines are considered successful',
description:
'Set whether or not merge requests can be merged with skipped jobs.',
type: 'boolean',
},
},
},
branches: {