Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for commit_committer_check and reject_unsigned_commits in push rules #246

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions gitlab/resource_gitlab_project_push_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ func resourceGitlabProjectPushRules() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
},
"commit_committer_check": {
Type: schema.TypeBool,
Optional: true,
},
"reject_unsigned_commits": {
Type: schema.TypeBool,
Optional: true,
},
},
}
}
Expand Down Expand Up @@ -120,6 +128,8 @@ func resourceGitlabProjectPushRulesRead(d *schema.ResourceData, meta interface{}
d.Set("member_check", pushRules.MemberCheck)
d.Set("prevent_secrets", pushRules.PreventSecrets)
d.Set("max_file_size", pushRules.MaxFileSize)
d.Set("commit_committer_check", pushRules.CommitCommitterCheck)
d.Set("reject_unsigned_commits", pushRules.RejectUnsignedCommits)
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/project_push_rules.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ The following arguments are supported:

* `commit_committer_check` - (Optional, bool) Users can only push commits to this repository that were committed with one of their own verified emails

* `reject_unsigned_commits` - (Optional, bool) Reject commit when it is not signed through GPG.

## Attributes Reference

The resource exports the following attributes:
Expand Down