-
Notifications
You must be signed in to change notification settings - Fork 1
Repos
Anton edited this page Dec 1, 2019
·
2 revisions
These methods allow to work with repositories.
-
async create(options: CreateRepository): Repository async delete(owner: string, name: string)async edit(options: Edit)async generate(string: templateOwner, string: templateName, options: Generate): Repository
Create a new repository.
CreateRepository: Options to create a repository.
| Name | Type | Description | Default |
|---|---|---|---|
| org | string | The organisation on which to create the repository (if not adding to the user account). | - |
| name* | string | The name of the repository. | - |
| description | string | A short description of the repository. | - |
| homepage | string | A URL with more information about the repository. | - |
| license_template | string | Choose an open source license template that best suits your needs, and then use the license keyword as the license_template string. For example, "mit" or "mpl-2.0". | - |
| gitignore_template | string | Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, "Haskell". | - |
| auto_init | boolean | Pass true to create an initial commit with empty README. |
false |
Repository
Owner
| Name | Type | Description |
|---|---|---|
| login* | string | octocat |
| id* | number | 1 |
| node_id* | string | MDQ6VXNlcjE= |
| avatar_url* | string | https://github.com/images/error/octocat_happy.gif |
| gravatar_id* | string | |
| url* | string | https://api.github.com/users/octocat |
| html_url* | string | https://github.com/octocat |
| followers_url* | string | https://api.github.com/users/octocat/followers |
| following_url* | string | https://api.github.com/users/octocat/following{/other_user} |
| gists_url* | string | https://api.github.com/users/octocat/gists{/gist_id} |
| starred_url* | string | https://api.github.com/users/octocat/starred{/owner}{/repo} |
| subscriptions_url* | string | https://api.github.com/users/octocat/subscriptions |
| organizations_url* | string | https://api.github.com/users/octocat/orgs |
| repos_url* | string | https://api.github.com/users/octocat/repos |
| events_url* | string | https://api.github.com/users/octocat/events{/privacy} |
| received_events_url* | string | https://api.github.com/users/octocat/received_events |
| type* | string | User |
| site_admin* | boolean | false |
Delete a repository.
Makes changes to the repository.
RepoEdit: Options to edit a repository.
| Name | Type | Description | Default |
|---|---|---|---|
| name | string | The name of the repository. | - |
| description | string | A short description of the repository. | - |
| homepage | string | A URL with more information about the repository. | - |
| private | boolean | Either true to make the repository private or false to make it public. Creating private repositories requires a paid GitHub account. |
false |
| has_issues | boolean | Either true to enable issues for this repository or false to disable them. |
true |
| has_projects | boolean | Either true to enable projects for this repository or false to disable them. |
true |
| has_wiki | boolean | Either true to enable the wiki for this repository or false to disable it. |
true |
| is_template | boolean | Either true to make this repo available as a template repository or false to prevent it. |
false |
| default_branch | string | Updates the default branch for this repository. | - |
| allow_squash_merge | boolean | Either true to allow squash-merging pull requests, or false to prevent squash-merging. |
true |
| allow_merge_commit | boolean | Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. |
true |
| allow_rebase_merge | boolean | Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. |
true |
| archived | boolean |
true to archive this repository. Note: You cannot unarchive repositories through the API. |
false |
Generates a new repository from the template.
Generate: Options to generate a repository from a template.
| Name | Type | Description |
|---|---|---|
| owner | string | The organisation on which to create the repository (if not adding to the user account). |
| name* | string | The name of the repository. |
| description | string | A short description of the repository. |
| private | boolean | Whether it is a private repository. |