project_push_rules
Gets or lists a project_push_rules resource.
Overview​
| Name | project_push_rules |
| Type | Resource |
| Id | gitlab.projects.project_push_rules |
Fields​
The following fields are returned by SELECT queries:
- get
GraphQL response envelope
| Name | Datatype | Description |
|---|---|---|
author_email_regex | string | All commit author emails must match the regular expression. |
branch_name_regex | string | All branch names must match the regular expression. |
commit_committer_check | boolean | Only allow commits where the committer email matches a verified GitLab user email. |
commit_committer_name_check | boolean | Only allow commits where the author name matches the GitLab user name. |
commit_message_negative_regex | string | No commit message is allowed to match the regular expression. |
commit_message_regex | string | All commit messages must match the regular expression. |
deny_delete_tag | boolean | Deny deleting a tag with git push. |
file_name_regex | string | All committed filenames must not match the regular expression. |
max_file_size | integer | Maximum file size (MB). |
member_check | boolean | Restrict commits by author (email) to existing GitLab users. |
prevent_secrets | boolean | GitLab rejects any files that are likely to contain secrets. |
reject_non_dco_commits | boolean | Reject commit when it is not DCO certified. |
reject_unsigned_commits | boolean | Reject commit when it is not signed through GPG. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | full_path, host | Project'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.
| Name | Datatype | Description |
|---|---|---|
full_path | string | Full path of the project, for example gitlab-org/gitlab |
host | string | GitLab 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​
- get
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)
;