Description Usage Arguments Details Value Examples
This function can be used to invite a user into an organization or team, or update their role within the organization or team.
1 | update_membership(user, org, team, role, ...)
|
user |
(string) The login of the user. |
org |
(string) The login of the organization. |
team |
(integer or string, optional) The ID or name of the team. |
role |
(string, optional) The role to give the user. For an organization
this is either |
... |
Parameters passed to |
Note: you can only invite or update a user if the authenticate user is an organization "owner" or a team "maintainer".
For more details see the GitHub API documentation:
https://docs.github.com/en/rest/reference/orgs#set-organization-membership-for-a-user
https://docs.github.com/en/rest/reference/teams#add-or-update-team-membership-for-a-user
update_memberships()
returns a list of membership properties
Membership Properties:
user: The user login.
organization: The organization login.
team: The team name (team membership only).
role: The role of the user - for organizations it is either "member"
or "admin"
, for teams it is either "member"
or "maintainer"
.
state: The state of the membership - either "active"
or "pending"
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# Invite a new user into an organization
update_membership("ChadGoymer2", "HairyCoos")
# Update a user's role in an organization
update_membership("ChadGoymer2", "HairyCoos", role = "admin")
# Invite a new user into a team
update_membership("ChadGoymer2", "HairyCoos", "HeadCoos")
# Update a user's role in a team
update_membership(
user = "ChadGoymer2",
org = "HairyCoos",
team = "HeadCoos",
role = "maintainer"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.