Skip to main content

project_push_rules

Gets or lists a project_push_rules resource.

Overview​

Nameproject_push_rules
TypeResource
Idgitlab.projects.project_push_rules

Fields​

The following fields are returned by SELECT queries:

GraphQL response envelope

NameDatatypeDescription
author_email_regexstringAll commit author emails must match the regular expression.
branch_name_regexstringAll branch names must match the regular expression.
commit_committer_checkbooleanOnly allow commits where the committer email matches a verified GitLab user email.
commit_committer_name_checkbooleanOnly allow commits where the author name matches the GitLab user name.
commit_message_negative_regexstringNo commit message is allowed to match the regular expression.
commit_message_regexstringAll commit messages must match the regular expression.
deny_delete_tagbooleanDeny deleting a tag with git push.
file_name_regexstringAll committed filenames must not match the regular expression.
max_file_sizeintegerMaximum file size (MB).
member_checkbooleanRestrict commits by author (email) to existing GitLab users.
prevent_secretsbooleanGitLab rejects any files that are likely to contain secrets.
reject_non_dco_commitsbooleanReject commit when it is not DCO certified.
reject_unsigned_commitsbooleanReject commit when it is not signed through GPG.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfull_path, hostProject's push rules settings. Generated from the GitLab GraphQL schema field Project.pushRules (PushRules).

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
full_pathstringFull path of the project, for example gitlab-org/gitlab
hoststringGitLab host, with an optional port (default gitlab.com). Resolved from the GITLAB_HOST environment variable when it is set (x-stackQL-envVar); a WHERE host value always takes precedence. Self-managed instances: the provider is generated from the gitlab.com schema, so older instances may reject fields they do not serve. (default: gitlab.com, x-stackQL-envVar: GITLAB_HOST)

SELECT examples​

Project's push rules settings. Generated from the GitLab GraphQL schema field Project.pushRules (PushRules).

SELECT
author_email_regex,
branch_name_regex,
commit_committer_check,
commit_committer_name_check,
commit_message_negative_regex,
commit_message_regex,
deny_delete_tag,
file_name_regex,
max_file_size,
member_check,
prevent_secrets,
reject_non_dco_commits,
reject_unsigned_commits
FROM gitlab.projects.project_push_rules
WHERE full_path = '{{ full_path }}' -- required
AND host = '{{ host }}' -- required (defaults to gitlab.com; or set GITLAB_HOST)
;