Description Usage Arguments Details Value Examples
View source: R/collaborators.R
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.
1 | update_collaborator(user, repo, project, org, permission, ...)
|
user |
(string) The login of the user. |
repo |
(string, optional) The repository specified in the format:
|
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 |
... |
Parameters passed to |
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:
https://docs.github.com/en/rest/reference/repos#add-a-repository-collaborator
https://docs.github.com/en/rest/reference/projects#add-project-collaborator
update_collaborator()
returns TRUE
if successful.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.