ProjectPushRules

class ProjectPushRules : KotlinCustomResource

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const sample = new gitlab.ProjectPushRules("sample", {
project: "42",
authorEmailRegex: "@gitlab.com$",
branchNameRegex: "(feat|fix)\\/*",
commitCommitterCheck: true,
commitCommitterNameCheck: true,
commitMessageNegativeRegex: "ssh\\:\\/\\/",
commitMessageRegex: "(feat|fix):.*",
denyDeleteTag: false,
fileNameRegex: "(jar|exe)$",
maxFileSize: 4,
memberCheck: true,
preventSecrets: true,
rejectUnsignedCommits: false,
});
import pulumi
import pulumi_gitlab as gitlab
sample = gitlab.ProjectPushRules("sample",
project="42",
author_email_regex="@gitlab.com$",
branch_name_regex="(feat|fix)\\/*",
commit_committer_check=True,
commit_committer_name_check=True,
commit_message_negative_regex="ssh\\:\\/\\/",
commit_message_regex="(feat|fix):.*",
deny_delete_tag=False,
file_name_regex="(jar|exe)$",
max_file_size=4,
member_check=True,
prevent_secrets=True,
reject_unsigned_commits=False)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var sample = new GitLab.ProjectPushRules("sample", new()
{
Project = "42",
AuthorEmailRegex = "@gitlab.com$",
BranchNameRegex = "(feat|fix)\\/*",
CommitCommitterCheck = true,
CommitCommitterNameCheck = true,
CommitMessageNegativeRegex = "ssh\\:\\/\\/",
CommitMessageRegex = "(feat|fix):.*",
DenyDeleteTag = false,
FileNameRegex = "(jar|exe)$",
MaxFileSize = 4,
MemberCheck = true,
PreventSecrets = true,
RejectUnsignedCommits = false,
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.NewProjectPushRules(ctx, "sample", &gitlab.ProjectPushRulesArgs{
Project: pulumi.String("42"),
AuthorEmailRegex: pulumi.String("@gitlab.com$"),
BranchNameRegex: pulumi.String("(feat|fix)\\/*"),
CommitCommitterCheck: pulumi.Bool(true),
CommitCommitterNameCheck: pulumi.Bool(true),
CommitMessageNegativeRegex: pulumi.String("ssh\\:\\/\\/"),
CommitMessageRegex: pulumi.String("(feat|fix):.*"),
DenyDeleteTag: pulumi.Bool(false),
FileNameRegex: pulumi.String("(jar|exe)$"),
MaxFileSize: pulumi.Int(4),
MemberCheck: pulumi.Bool(true),
PreventSecrets: pulumi.Bool(true),
RejectUnsignedCommits: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.ProjectPushRules;
import com.pulumi.gitlab.ProjectPushRulesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var sample = new ProjectPushRules("sample", ProjectPushRulesArgs.builder()
.project(42)
.authorEmailRegex("@gitlab.com$")
.branchNameRegex("(feat|fix)\\/*")
.commitCommitterCheck(true)
.commitCommitterNameCheck(true)
.commitMessageNegativeRegex("ssh\\:\\/\\/")
.commitMessageRegex("(feat|fix):.*")
.denyDeleteTag(false)
.fileNameRegex("(jar|exe)$")
.maxFileSize(4)
.memberCheck(true)
.preventSecrets(true)
.rejectUnsignedCommits(false)
.build());
}
}
resources:
sample:
type: gitlab:ProjectPushRules
properties:
project: 42
authorEmailRegex: '@gitlab.com$'
branchNameRegex: (feat|fix)\/*
commitCommitterCheck: true
commitCommitterNameCheck: true
commitMessageNegativeRegex: ssh\:\/\/
commitMessageRegex: (feat|fix):.*
denyDeleteTag: false
fileNameRegex: (jar|exe)$
maxFileSize: 4
memberCheck: true
preventSecrets: true
rejectUnsignedCommits: false

Import

Starting in Terraform v1.5.0 you can use an import block to import gitlab_project_push_rules. For example: terraform import { to = gitlab_project_push_rules.example id = "see CLI command below for ID" } Import using the CLI is supported using the following syntax: Gitlab project push rules can be imported with a key composed of <project_id>, e.g.

$ pulumi import gitlab:index/projectPushRules:ProjectPushRules sample "42"

//////

Properties

Link copied to clipboard

All commit author emails must match this regex, e.g. @my-company.com$.

Link copied to clipboard
val branchNameRegex: Output<String>

All branch names must match this regex, e.g. (feature|hotfix)\/*. */

Link copied to clipboard

Users can only push commits to this repository that were committed with one of their own verified emails.

Link copied to clipboard

Users can only push commits to this repository if the commit author name is consistent with their GitLab account name.

Link copied to clipboard

No commit message is allowed to match this regex, e.g. ssh\:\/\/.

Link copied to clipboard

All commit messages must match this regex, e.g. Fixed \d+\..*.

Link copied to clipboard
val denyDeleteTag: Output<Boolean>

Deny deleting a tag.

Link copied to clipboard
val fileNameRegex: Output<String>

All committed filenames must not match this regex, e.g. (jar|exe)$.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val maxFileSize: Output<Int>

Maximum file size (MB).

Link copied to clipboard
val memberCheck: Output<Boolean>

Restrict commits by author (email) to existing GitLab users.

Link copied to clipboard
val preventSecrets: Output<Boolean>

GitLab will reject any files that are likely to contain secrets.

Link copied to clipboard
val project: Output<String>

The ID or URL-encoded path of the project.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Reject commit when it’s not DCO certified.

Link copied to clipboard

Reject commit when it’s not signed.

Link copied to clipboard
val urn: Output<String>