Project Push Rules
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
All commit author emails must match this regex, e.g. @my-company.com$
.
All branch names must match this regex, e.g. (feature|hotfix)\/*
. */
Users can only push commits to this repository that were committed with one of their own verified emails.
Users can only push commits to this repository if the commit author name is consistent with their GitLab account name.
No commit message is allowed to match this regex, e.g. ssh\:\/\/
.
All commit messages must match this regex, e.g. Fixed \d+\..*
.
Deny deleting a tag.
All committed filenames must not match this regex, e.g. (jar|exe)$
.
Maximum file size (MB).
Restrict commits by author (email) to existing GitLab users.
GitLab will reject any files that are likely to contain secrets.
Reject commit when it’s not DCO certified.
Reject commit when it’s not signed.