Description Usage Arguments Details Value Examples
This function creates a new repository for the authenticated user or an organization in GitHub. It can also be used to specify whether the project is private or has issues, projects or a wiki and can define the allowed behaviour when merging pull requests.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
name |
(string) The name of the repository. |
org |
(string, optional) The name of the organization. |
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. Default: |
has_issues |
(boolean, optional) Whether to enable issues for the
repository. Default: |
has_projects |
(boolean, optional) Whether to enable projects for the
repository. Default: |
has_wiki |
(boolean, optional) Whether to enable the wiki for the
repository. Default: |
auto_init |
(boolean, optional) Whether to create an initial commit with
empty README. Default: |
allow_squash_merge |
(boolean, optional) Whether to allow squash-merging
pull requests. Default: |
allow_merge_commit |
(boolean, optional) Whether to allow merging pull
requests with a merge commit. Default: |
allow_rebase_merge |
(boolean, optional) Whether to allow rebase-merging
pull requests. Default: |
delete_branch_on_merge |
(boolean, optional) Whether to allow
automatically deleting branches when pull requests are merged. Default:
|
... |
Parameters passed to |
For more details see the GitHub API documentation:
https://docs.github.com/en/rest/reference/repos#create-a-repository-for-the-authenticated-user
https://docs.github.com/en/rest/reference/repos#create-an-organization-repository
create_repository()
returns a list of the repository's 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 | ## Not run:
create_repository(
name = "user-repository",
description = "This is a user repository",
homepage = "https://user-repository.com"
)
create_repository(
name = "org-repository",
org = "HairyCoos",
description = "This is a organization repository",
homepage = "https://org-repository.com"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.