create_team: Create a team in a GitHub organization

Description Usage Arguments Details Value Examples

View source: R/teams.R

Description

This function creates a new team in the specified organization in GitHub. It can also be used to specify the maintainers, the repositories to add the team to and a parent team.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
create_team(
  name,
  org,
  description,
  maintainers,
  repo_names,
  privacy,
  parent_team,
  ...
)

Arguments

name

(string) The name of the team.

org

(string) The login of the organization.

description

(string, optional) The description of the team.

maintainers

(character, optional) The logins of organization members to add as maintainers of the team. If you do not specify any maintainers, then you will automatically become a team maintainer when you create a new team.

repo_names

(character, optional) The full name (e.g. "organization-name/repository-name") of repositories to add the team to.

privacy

(string, optional) The level of privacy this team should have. The options are:

For a non-nested team:

  • "secret": only visible to organization owners and members of this team.

  • "closed": visible to all members of this organization.

Default: "secret".

For a parent or child team:

  • "closed": visible to all members of this organization.

Default for child team: "closed"

parent_team

(integer or string, optional) The ID or name of a team to set as the parent team.

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

create_team() returns a list of the team's properties.

Team Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 

  # Create a team in an organization
  create_team("TestTeam", "HairyCoos")

  # Create a team and specify maintainers
  create_team(
    name        = "TestTeam2",
    org         = "HairyCoos",
    maintainers = c("ChadGoymer", "chris-walker1")
  )

  # Create a team and set the privacy
  create_team("TestTeam3", "HairyCoos", privacy = "closed")

  # Create a team and specify a parent team
  create_team("TestTeam4", "HairyCoos", parent_team = "TestTeam3")


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.