update_collaborator: Update collaborators for a repository or project

Description Usage Arguments Details Value Examples

View source: R/collaborators.R

Description

This function can be used to invite a user to collaborate on either a repository or project, or update their permission within the repository or project.

Usage

1
update_collaborator(user, repo, project, org, permission, ...)

Arguments

user

(string) The login of the user.

repo

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

project

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

org

(string, optional) The name of the organization. Only required for projects.

permission

(string, optional) The permission to give the user. For a repository this is either "pull", "push" or "admin", for a project it is either "read", "write" or "admin".

...

Parameters passed to gh_request().

Details

Note: you can only invite or update a user if the authenticate user is an "admin" of the repository or project.

For more details see the GitHub API documentation:

Value

update_collaborator() returns TRUE if successful.

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
## Not run: 

  # Invite a user to collaborate on a repository
  update_collaborator(user = "ChadGoymer2", repo = "ChadGoymer/githapi")

  # Invite a user to collaborate on a project
  update_collaborator(
    user    = "ChadGoymer2",
    project = "TestProject",
    org     = "HairyCoos"
  )

  # Update a user's permissions on a repository
  update_collaborator(
    user       = "ChadGoymer2",
    repo       = "ChadGoymer/githapi",
    permission = "admin"
  )

  # Update a user's permissions on a project
  update_collaborator(
    user       = "ChadGoymer2",
    project    = "TestProject",
    org        = "HairyCoos",
    permission = "read"
  )


## End(Not run)

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