Description Usage Arguments Details Value Examples
This function updates a repository for the authenticated user or organization in GitHub. It can be used to change whether the project is private or has issues, projects or a wiki, it can redefine the allowed behaviour when merging pull requests or add or update team permissions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | update_repository(
repo,
name,
description,
homepage,
private,
has_issues,
has_projects,
has_wiki,
default_branch,
allow_squash_merge,
allow_merge_commit,
allow_rebase_merge,
delete_branch_on_merge,
archived,
team,
permission = "pull",
...
)
|
repo |
(string) The repository specified in the format: |
name |
(string, optional) The name of the repository. |
description |
(string, optional) A short description of the repository. |
homepage |
(string, optional) A URL with more information about the repository. |
private |
(boolean, optional) Whether the repository is private or public. |
has_issues |
(boolean, optional) Whether to enable issues for the repository. |
has_projects |
(boolean, optional) Whether to enable projects for the repository. |
has_wiki |
(boolean, optional) Whether to enable the wiki for the repository. |
default_branch |
(string, optional) The name of the default branch. |
allow_squash_merge |
(boolean, optional) Whether to allow squash-merging pull requests. |
allow_merge_commit |
(boolean, optional) Whether to allow merging pull requests with a merge commit. |
allow_rebase_merge |
(boolean, optional) Whether to allow rebase-merging pull requests. |
delete_branch_on_merge |
(boolean, optional) Whether to allow automatically deleting branches when pull requests are merged. |
archived |
(boolean, optional) Whether to archive the repository. |
team |
(string) The team name. |
permission |
(string, optional) The permission to set for the team.
Either: |
... |
Parameters passed to |
The team's permission can be set to:
"pull"
: Team members can pull from this repository.
"push"
: Team members can pull from and push to this repository.
"admin"
: Team members can pull from, push to and administer this
repository.
"maintain"
: Team members can manage the repository without access to
sensitive or destructive actions. Recommended for project managers. Only
applies to repositories owned by organizations.
"triage"
: Team members can proactively manage issues and pull requests
without write access. Recommended for contributors who triage a repository.
Only applies to repositories owned by organizations.
For more details see the GitHub API documentation:
https://docs.github.com/en/rest/reference/repos#update-a-repository
https://docs.github.com/en/rest/reference/teams#add-or-update-team-repository-permissions
update_repository()
returns a list of the repository properties.
Repository Properties:
id: The ID of the repository.
name: The name of the repository.
full_name: The full name of the repository, in the format:
owner/repo
.
description: The description of the repository.
owner: The owner of the repository.
html_url: The address of the repository's web page in GitHub.
homepage: The homepage for the repository.
language: The dominant programming language in the repository.
size: The overall size of the repository in bytes.
default_branch: The name of the default branch.
permission: The permission the authenticated user has.
private: Whether the repository is private.
has_issues: Whether the repository has issues.
has_projects: Whether the repository has projects.
has_wiki: Whether the repository has a wiki.
has_pages: Whether the repository has GitHub Pages.
has_downloads: Whether the repository has downloads.
allow_squash_merge: Whether the repository allows squash-merging pull requests.
allow_merge_commit: Whether the repository allows merging pull requests with a merge commit.
allow_rebase_merge: Whether the repository allows rebase-merging pull requests.
fork: Whether the repository is a fork of another.
archived: Whether the repository has been archived.
disabled: Whether the repository has been disabled.
watchers_count: The number of watchers.
stargazers_count: The number of stars.
forks_count: The number of forks.
pushed_at: When the repository was last pushed to.
created_at: When the repository was created.
updated_at: When the repository was last updated.
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 43 44 45 | ## Not run:
# Update a repository
update_repository(
repo = "ChadGoymer/user-repository",
name = "updated-user-repository",
description = "This is an updated user repository",
homepage = "https://updated-user-repository.com",
has_issues = FALSE,
has_projects = FALSE,
has_wiki = FALSE,
default_branch = "main"
)
# Update an organization's repository
update_repository(
repo = "HairyCoos/org-repository",
name = "updated-org-repository",
description = "This is an updated organization repository",
homepage = "https://updated-org-repository.com",
private = FALSE,
allow_squash_merge = FALSE,
allow_merge_commit = FALSE,
allow_rebase_merge = TRUE,
delete_branch_on_merge = TRUE
)
# Archive a repository
update_repository("HairyCoos/org-repository", archived = TRUE)
# Add read access for the specified team
update_repository(
repo = "HairyCoos/test-repository",
team = "test-team"
)
# Update team's permission to "maintain"
update_repository(
repo = "HairyCoos/test-repository",
team = "test-team",
permission = "maintain"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.