Method: Octokit::Client::Organizations#create_team

Defined in:
lib/octokit/client/organizations.rb

#create_team(org, options = {}) ⇒ Sawyer::Resource

Create team

Requires authenticated organization owner.

Examples:

@client.create_team('github', {
  :name => 'Designers',
  :repo_names => ['github/dotfiles']
})

Parameters:

  • org (String, Integer)

    Organization GitHub login or id.

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

    a customizable set of options

Options Hash (options):

  • :name (String)

    Team name.

  • :repo_names (Array<String>)

    Repositories for the team.

  • :maintainers (Array<String>)

    Maintainers for the team.

  • :parent_team_id (Integer)

    ID of a team to set as the parent team.

Returns:

  • (Sawyer::Resource)

    Hash representing new team.

See Also:



320
321
322
323
324
325
# File 'lib/octokit/client/organizations.rb', line 320

def create_team(org, options = {})
  if options.key?(:permission)
    octokit_warn 'Deprecated: Passing :permission option to #create_team. Assign team repository permission by passing :permission to #add_team_repository instead.'
  end
  post "#{Organization.path org}/teams", options
end