Method: Gitlab::Client::Projects#add_push_rule

Defined in:
lib/gitlab/client/projects.rb

#add_push_rule(id, options = {}) ⇒ Gitlab::ObjectifiedHash

Adds a project push rule.

Examples:

Gitlab.add_push_rule(42, { deny_delete_tag: false, commit_message_regex: '\\b[A-Z]{3}-[0-9]+\\b' })

Parameters:

  • id (Integer)

    The ID of a project.

  • options (Hash) (defaults to: {})

    A customizable set of options.

  • option (Boolean)

    :deny_delete_tag Do not allow users to remove git tags with git push (0 = false, 1 = true)

  • option (String)

    :commit_message_regex Commit message regex

Returns:

See Also:

[View source]

283
284
285
# File 'lib/gitlab/client/projects.rb', line 283

def add_push_rule(id, options = {})
  post("/projects/#{url_encode id}/push_rule", body: options)
end