update_project: Update a GitHub project

Description Usage Arguments Details Value Examples

View source: R/projects.R

Description

This function updates a project in GitHub. It can be used to change the name and body, but can also be used to close the project, change permissions or add a team.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
update_project(
  project,
  name,
  body,
  state,
  permission,
  private,
  repo,
  user,
  team,
  org,
  ...
)

Arguments

project

(integer or string) Either the project number or name.

name

(string, optional) The new name for the project.

body

(string, optional) The new description of the project.

state

(string, optional) The new state of the project, either "open" or "closed".

permission

(string, optional) The new team or organisation permissions for the project, either "read", "write", "admin" or "none". Note: applies to team and organization projects only.

private

(boolean, optional) Whether the project should be private. Note: applies to team and organization projects only.

repo

(string, optional) The repository specified in the format: owner/repo.

user

(string, optional) The login of the user.

team

(string or integer, optional) The team ID or name.

org

(string, optional) The name of the organization.

...

Parameters passed to gh_request().

Details

You can update a project associated with either a repository, user, team or organization, by supplying them as an input, as long as you have appropriate permissions. Supplying a team that does not already have access to the project adds them. If they have access, then the team's permissions can be changed with the permission argument.

For more details see the GitHub API documentation:

Value

update_project() returns a list of the project properties.

Project Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
## Not run: 

  # Update the name of a project for a repository
  update_project(
    project = "Repo project",
    name    = "Updated repo project",
    body    = "This is an updated repository's project",
    repo    = "ChadGoymer/githapi"
  )

  # Update the state of a project for a user
  update_project(
    name  = "User project",
    state = "closed",
    user  = "ChadGoymer"
  )

  # Update the permissions of a project for an organization
  update_project(
    name       = "Org project",
    permission = "read",
    private    = TRUE,
    org        = "HairyCoos"
  )

  # Add a team to the project
  update_project(
    project = "Org project",
    team    = "HeadCoos",
    org     = "HairyCoos"
  )

  # Update the team's permissions on the project
  update_project(
    project    = "Org project",
    permission = "write",
    team       = "HeadCoos",
    org        = "HairyCoos"
  )


## End(Not run)

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