octokit.repos.acceptInvitation({invitation_id,});
name | required | description |
---|---|---|
invitation_id | yes | invitation_id parameter |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Grants the specified apps push access for this branch. Only installed GitHub Apps with write
access to the contents
permission can be added as authorized actors on a protected branch.
Type | Description |
---|---|
array | The GitHub Apps that have push access to this branch. Use the app's slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.addAppAccessRestrictions({owner,repo,branch,apps,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
apps | yes |
See also: GitHub Developer Guide documentation.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in abuse rate limiting. See "Abuse rate limits" and "Dealing with abuse rate limits" for details.
For more information the permission levels, see "Repository permission levels for an organization".
Note that, if you choose not to pass any parameters, you'll need to set Content-Length
to zero when calling out to this endpoint. For more information, see "HTTP verbs."
The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the repository invitations API endpoints.
Rate limits
To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.
octokit.repos.addCollaborator({owner,repo,username,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
username | yes | |
permission | no | The permission to grant the collaborator. Only valid on organization-owned repositories. Can be one of: |
permissions | no |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.addStatusCheckContexts({owner,repo,branch,contexts,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
contexts | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Grants the specified teams push access for this branch. You can also give push access to child teams.
Type | Description |
---|---|
array | The teams that can have push access. Use the team's slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.addTeamAccessRestrictions({owner,repo,branch,teams,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
teams | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Grants the specified people push access for this branch.
Type | Description |
---|---|
array | Usernames for people who can have push access. Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.addUserAccessRestrictions({owner,repo,branch,users,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
users | yes |
See also: GitHub Developer Guide documentation.
For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.
Team members will include the members of child teams.
octokit.repos.checkCollaborator({owner,repo,username,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "About security alerts for vulnerable dependencies".
octokit.repos.checkVulnerabilityAlerts({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Both :base
and :head
must be branch names in :repo
. To compare branches across other repositories in the same network as :repo
, use the format <USERNAME>:branch
.
The response from the API is equivalent to running the git log base..head
command; however, commits are returned in chronological order. Pass the appropriate media type to fetch diff and patch formats.
The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a renamed
status have a previous_filename
field showing the previous filename of the file, and files with a modified
status have a patch
field showing the changes made to the file.
Working with large comparisons
The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the List commits to enumerate all commits in the range.
For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long to generate. You can typically resolve this error by using a smaller commit range.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit's signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user's account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
octokit.repos.compareCommits({owner,repo,base,head,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
base | yes | |
head | yes |
See also: GitHub Developer Guide documentation.
Create a comment for a commit using its :commit_sha
.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in abuse rate limiting. See "Abuse rate limits" and "Dealing with abuse rate limits" for details.
octokit.repos.createCommitComment({owner,repo,commit_sha,body,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
commit_sha | yes | commit_sha parameter |
body | yes | The contents of the comment. |
path | no | Relative path of the file to comment on. |
position | no | Line index in the diff to comment on. |
line | no | Deprecated. Use position parameter instead. Line number in the file to comment on. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.
octokit.repos.createCommitSignatureProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Users with push access in a repository can create commit statuses for a given SHA.
Note: there is a limit of 1000 statuses per sha
and context
within a repository. Attempts to create more than 1000 statuses will result in a validation error.
octokit.repos.createCommitStatus({owner,repo,sha,state,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
sha | yes | |
state | yes | The state of the status. Can be one of |
target_url | no | The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. |
description | no | A short description of the status. |
context | no | A string label to differentiate this status from the status of other systems. This field is case-insensitive. |
See also: GitHub Developer Guide documentation.
You can create a read-only deploy key.
octokit.repos.createDeployKey({owner,repo,key,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
title | no | A name for the key. |
key | yes | The contents of the key. |
read_only | no | If Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "Repository permission levels for an organization" and "Permission levels for a user account repository." |
See also: GitHub Developer Guide documentation.
Deployments offer a few configurable parameters with certain defaults.
The ref
parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request.
The environment
parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as production
, staging
, and qa
. This parameter makes it easier to track which environments have requested deployments. The default environment is production
.
The auto_merge
parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref is behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response.
By default, commit statuses for every submitted context must be in a success
state. The required_contexts
parameter allows you to specify a subset of contexts that must be success
, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed.
The payload
parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched.
The task
parameter is used by the deployment system to allow different execution paths. In the web world this might be deploy:migrations
to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled.
Users with repo
or repo_deployment
scopes can create a deployment for a given ref.
You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when:
master
in the response exampleIf there are no new commits in the base branch, a new request to create a deployment should give a successful response.
This error happens when the auto_merge
option is enabled and when the default branch (in this case master
), can't be merged into the branch that's being deployed (in this case topic-branch
), due to merge conflicts.
This error happens when the required_contexts
parameter indicates that one or more contexts need to have a success
status for the commit to be deployed, but one or more of the required contexts do not have a state of success
.
octokit.repos.createDeployment({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes | The ref to deploy. This can be a branch, tag, or SHA. |
task | no | Specifies a task to execute (e.g., |
auto_merge | no | Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. |
required_contexts | no | The status contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. |
payload | no | |
environment | no | Name for the target deployment environment (e.g., |
description | no | Short description of the deployment. |
transient_environment | no | Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: |
production_environment | no | Specifies if the given environment is one that end-users directly interact with. Default: |
created_at | no |
See also: GitHub Developer Guide documentation.
Users with push
access can create deployment statuses for a given deployment.
GitHub Apps require read & write
access to "Deployments" and read-only
access to "Repo contents" (for private repos). OAuth Apps require the repo_deployment
scope.
octokit.repos.createDeploymentStatus({owner,repo,deployment_id,state,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
deployment_id | yes | deployment_id parameter |
state | yes | The state of the status. Can be one of |
target_url | no | The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Note: It's recommended to use the |
log_url | no | The full URL of the deployment's output. This parameter replaces |
description | no | A short description of the status. The maximum description length is 140 characters. |
environment | no | Name for the target deployment environment, which can be changed when setting a deploy status. For example, |
environment_url | no | Sets the URL for accessing your environment. Default: |
auto_inactive | no | Adds a new |
See also: GitHub Developer Guide documentation.
You can use this endpoint to trigger a webhook event called repository_dispatch
when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the repository_dispatch
event occurs. For an example repository_dispatch
webhook payload, see "RepositoryDispatchEvent."
The client_payload
parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the client_payload
can include a message that a user would like to send using a GitHub Actions workflow. Or the client_payload
can be used as a test to debug your workflow.
This endpoint requires write access to the repository by providing either:
repo
scope. For more information, see "Creating a personal access token for the command line" in the GitHub Help documentation.metadata:read
and contents:read&write
permissions.This input example shows how you can use the client_payload
as a test to debug your workflow.
octokit.repos.createDispatchEvent({owner,repo,event_type,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
event_type | yes | A custom webhook event name. |
client_payload | no | JSON payload with extra information about the webhook event that your action or worklow may use. |
client_payload.* | no |
See also: GitHub Developer Guide documentation.
Creates a new repository for the authenticated user.
OAuth scope requirements
When using OAuth, authorizations must include:
public_repo
scope or repo
scope to create a public repositoryrepo
scope to create a private repositoryoctokit.repos.createForAuthenticatedUser({name,});
name | required | description |
---|---|---|
name | yes | The name of the repository. |
description | no | A short description of the repository. |
homepage | no | A URL with more information about the repository. |
private | no | Whether the repository is private or public. |
has_issues | no | Whether issues are enabled. |
has_projects | no | Whether projects are enabled. |
has_wiki | no | Whether the wiki is enabled. |
team_id | no | The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. |
auto_init | no | Whether the repository is initialized with a minimal README. |
gitignore_template | no | The desired language or platform to apply to the .gitignore. |
license_template | no | The license keyword of the open source license for this repository. |
allow_squash_merge | no | Whether to allow squash merges for pull requests. |
allow_merge_commit | no | Whether to allow merge commits for pull requests. |
allow_rebase_merge | no | Whether to allow rebase merges for pull requests. |
delete_branch_on_merge | no | Whether to delete head branches when pull requests are merged |
has_downloads | no | Whether downloads are enabled. |
is_template | no | Whether this repository acts as a template that can be used to generate new repositories. |
See also: GitHub Developer Guide documentation.
Create a fork for the authenticated user.
Note: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact GitHub Support or GitHub Premium Support.
octokit.repos.createFork({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
organization | no | Optional parameter to specify the organization name if forking into an organization. |
See also: GitHub Developer Guide documentation.
Creates a new repository in the specified organization. The authenticated user must be a member of the organization.
OAuth scope requirements
When using OAuth, authorizations must include:
public_repo
scope or repo
scope to create a public repositoryrepo
scope to create a private repositoryoctokit.repos.createInOrg({org,name,});
name | required | description |
---|---|---|
org | yes | |
name | yes | The name of the repository. |
description | no | A short description of the repository. |
homepage | no | A URL with more information about the repository. |
private | no | Either |
visibility | no | Can be |
has_issues | no | Either |
has_projects | no | Either |
has_wiki | no | Either |
is_template | no | Either |
team_id | no | The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. |
auto_init | no | Pass |
gitignore_template | no | Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, "Haskell". |
license_template | no | Choose an open source license template that best suits your needs, and then use the license keyword as the |
allow_squash_merge | no | Either |
allow_merge_commit | no | Either |
allow_rebase_merge | no | Either |
delete_branch_on_merge | no | Either |
See also: GitHub Developer Guide documentation.
Creates a new file or replaces an existing file in a repository.
octokit.repos.createOrUpdateFileContents({owner,repo,path,message,content,committer.name,committer.email,author.name,author.email})
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
path | yes | path+ parameter |
message | yes | The commit message. |
content | yes | The new file content, using Base64 encoding. |
sha | no | Required if you are updating a file. The blob SHA of the file being replaced. |
branch | no | The branch name. Default: the repository’s default branch (usually |
committer | no | The person that committed the file. Default: the authenticated user. |
committer.name | yes | The name of the author or committer of the commit. You'll receive a |
committer.email | yes | The email of the author or committer of the commit. You'll receive a |
committer.date | no | |
author | no | The author of the file. Default: The |
author.name | yes | The name of the author or committer of the commit. You'll receive a |
author.email | yes | The email of the author or committer of the commit. You'll receive a |
author.date | no |
See also: GitHub Developer Guide documentation.
Configures a GitHub Pages site. For more information, see "About GitHub Pages."
octokit.repos.createPagesSite({owner,repo,source,source.branch})
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
source | yes | The source branch and directory used to publish your Pages site. |
source.branch | yes | The repository branch used to publish your site's source files. |
source.path | no | The repository directory that includes the source files for the Pages site. Allowed paths are |
See also: GitHub Developer Guide documentation.
Users with push access to the repository can create a release.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in abuse rate limiting. See "Abuse rate limits" and "Dealing with abuse rate limits" for details.
octokit.repos.createRelease({owner,repo,tag_name,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
tag_name | yes | The name of the tag. |
target_commitish | no | Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually |
name | no | The name of the release. |
body | no | Text describing the contents of the tag. |
draft | no |
|
prerelease | no |
|
See also: GitHub Developer Guide documentation.
Creates a new repository using a repository template. Use the template_owner
and template_repo
route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the Get a repository endpoint and check that the is_template
key is true
.
OAuth scope requirements
When using OAuth, authorizations must include:
public_repo
scope or repo
scope to create a public repositoryrepo
scope to create a private repositoryoctokit.repos.createUsingTemplate({template_owner,template_repo,name,});
name | required | description |
---|---|---|
template_owner | yes | |
template_repo | yes | |
owner | no | The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. |
name | yes | The name of the new repository. |
description | no | A short description of the new repository. |
include_all_branches | no | Set to |
private | no | Either |
See also: GitHub Developer Guide documentation.
Repositories can have multiple webhooks installed. Each webhook should have a unique config
. Multiple webhooks can share the same config
as long as those webhooks do not have any events
that overlap.
octokit.repos.createWebhook({owner,repo,config,config.url})
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
name | no | Use |
config | yes | Key/value pairs to provide settings for this webhook. These are defined below. |
config.url | yes | The URL to which the payloads will be delivered. |
config.content_type | no | The media type used to serialize the payloads. Supported values include |
config.secret | no | If provided, the |
config.insecure_ssl | no | Determines whether the SSL certificate of the host for |
config.token | no | |
config.digest | no | |
events | no | Determines what events the hook is triggered for. |
active | no | Determines if notifications are sent when the webhook is triggered. Set to |
See also: GitHub Developer Guide documentation.
octokit.repos.declineInvitation({invitation_id,});
name | required | description |
---|---|---|
invitation_id | yes | invitation_id parameter |
See also: GitHub Developer Guide documentation.
Deleting a repository requires admin access. If OAuth is used, the delete_repo
scope is required.
If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a 403 Forbidden
response.
octokit.repos.delete({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Disables the ability to restrict who can push to this branch.
octokit.repos.deleteAccessRestrictions({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
octokit.repos.deleteAdminBranchProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.deleteBranchProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
octokit.repos.deleteCommitComment({owner,repo,comment_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
comment_id | yes | comment_id parameter |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.
octokit.repos.deleteCommitSignatureProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.
octokit.repos.deleteDeployKey({owner,repo,key_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
key_id | yes | key_id parameter |
See also: GitHub Developer Guide documentation.
To ensure there can always be an active deployment, you can only delete an inactive deployment. Anyone with repo
or repo_deployment
scopes can delete an inactive deployment.
To set a deployment as inactive, you must:
For more information, see "Create a deployment" and "Create a deployment status."
octokit.repos.deleteDeployment({owner,repo,deployment_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
deployment_id | yes | deployment_id parameter |
See also: GitHub Developer Guide documentation.
Deletes a file in a repository.
You can provide an additional committer
parameter, which is an object containing information about the committer. Or, you can provide an author
parameter, which is an object containing information about the author.
The author
section is optional and is filled in with the committer
information if omitted. If the committer
information is omitted, the authenticated user's information is used.
You must provide values for both name
and email
, whether you choose to use author
or committer
. Otherwise, you'll receive a 422
status code.
octokit.repos.deleteFile({owner,repo,path,message,sha,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
path | yes | path+ parameter |
message | yes | The commit message. |
sha | yes | The blob SHA of the file being replaced. |
branch | no | The branch name. Default: the repository’s default branch (usually |
committer | no | object containing information about the committer. |
committer.name | no | The name of the author (or committer) of the commit |
committer.email | no | The email of the author (or committer) of the commit |
author | no | object containing information about the author. |
author.name | no | The name of the author (or committer) of the commit |
author.email | no | The email of the author (or committer) of the commit |
See also: GitHub Developer Guide documentation.
octokit.repos.deleteInvitation({owner,repo,invitation_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
invitation_id | yes | invitation_id parameter |
See also: GitHub Developer Guide documentation.
octokit.repos.deletePagesSite({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.deletePullRequestReviewProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Users with push access to the repository can delete a release.
octokit.repos.deleteRelease({owner,repo,release_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
release_id | yes | release_id parameter |
See also: GitHub Developer Guide documentation.
octokit.repos.deleteReleaseAsset({owner,repo,asset_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
asset_id | yes | asset_id parameter |
See also: GitHub Developer Guide documentation.
octokit.repos.deleteWebhook({owner,repo,hook_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "Configuring automated security fixes".
octokit.repos.disableAutomatedSecurityFixes({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "About security alerts for vulnerable dependencies".
octokit.repos.disableVulnerabilityAlerts({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Deprecated: This method has been renamed to repos.downloadZipballArchive
Gets a redirect URL to download a zip archive for a repository. If you omit :ref
, the repository’s default branch (usuallymaster
) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location
header to make a second GET
request.Note: For private repositories, these links are temporary and expire after five minutes.
octokit.repos.downloadArchive({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes |
See also: GitHub Developer Guide documentation.
Gets a redirect URL to download a tar archive for a repository. If you omit :ref
, the repository’s default branch (usuallymaster
) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location
header to make a second GET
request.Note: For private repositories, these links are temporary and expire after five minutes.
octokit.repos.downloadTarballArchive({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes |
See also: GitHub Developer Guide documentation.
Gets a redirect URL to download a zip archive for a repository. If you omit :ref
, the repository’s default branch (usuallymaster
) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location
header to make a second GET
request.Note: For private repositories, these links are temporary and expire after five minutes.
octokit.repos.downloadZipballArchive({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes |
See also: GitHub Developer Guide documentation.
Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "Configuring automated security fixes".
octokit.repos.enableAutomatedSecurityFixes({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "About security alerts for vulnerable dependencies".
octokit.repos.enableVulnerabilityAlerts({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
When you pass the scarlet-witch-preview
media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file.
The parent
and source
objects are present when the repository is a fork. parent
is the repository this repository was forked from, source
is the ultimate source for the network.
octokit.repos.get({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Lists who has access to this protected branch.
Note: Users, apps, and teams restrictions
are only available for organization-owned repositories.
octokit.repos.getAccessRestrictions({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.getAdminBranchProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.getAllStatusCheckContexts({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
octokit.repos.getAllTopics({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with write
access to the contents
permission can be added as authorized actors on a protected branch.
octokit.repos.getAppsWithAccessToProtectedBranch({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
octokit.repos.getBranch({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.getBranchProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
octokit.repos.getClones({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per | no | Must be one of: |
See also: GitHub Developer Guide documentation.
Returns a weekly aggregate of the number of additions and deletions pushed to a repository.
octokit.repos.getCodeFrequencyStats({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Checks the repository permission of a collaborator. The possible repository permissions are admin
, write
, read
, and none
.
octokit.repos.getCollaboratorPermissionLevel({owner,repo,username,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.
The most recent status for each context is returned, up to 100. This field paginates if there are over 100 contexts.
Additionally, a combined state
is returned. The state
is one of:
error
or failure
pending
success
octokit.repos.getCombinedStatusForRef({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes | ref+ parameter |
See also: GitHub Developer Guide documentation.
Returns the contents of a single commit reference. You must have read
access for the repository to use this endpoint.
Note: If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.
You can pass the appropriate media type to fetch diff
and patch
formats. Diffs with binary data will have no patch
property.
To return only the SHA-1 hash of the commit reference, you can provide the sha
custom media type in the Accept
header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit's signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user's account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
octokit.repos.getCommit({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes | ref+ parameter |
See also: GitHub Developer Guide documentation.
Returns the last year of commit activity grouped by week. The days
array is a group of commits per day, starting on Sunday
.
octokit.repos.getCommitActivityStats({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.getCommitComment({owner,repo,comment_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
comment_id | yes | comment_id parameter |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of true
indicates you must sign commits on this branch. For more information, see Signing commits with GPG in GitHub Help.
Note: You must enable branch protection to require signed commits.
octokit.repos.getCommitSignatureProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE_TEMPLATE, PULL_REQUEST_TEMPLATE, README, and CONTRIBUTING files.
The health_percentage
score is defined as a percentage of how many of these four documents are present: README, CONTRIBUTING, LICENSE, and CODE_OF_CONDUCT. For example, if all four documents are present, then the health_percentage
is 100
. If only one is present, then thehealth_percentage
is 25
.
content_reports_enabled
is only returned for organization-owned repositories.
octokit.repos.getCommunityProfileMetrics({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Gets the contents of a file or directory in a repository. Specify the file path or directory in :path
. If you omit:path
, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories.
Files and symlinks support a custom media type for retrieving the raw content or rendered HTML (when supported). All content types support a custom media type to ensure the content is returned in a consistent object format.
Note:
The response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the valueshould be "submodule". This behavior exists in API v3 for backwards compatibility purposes. In the next major version of the API, the type will be returned as "submodule".
If the requested :path
points to a symlink, and the symlink's target is a normal file in the repository, then the API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object describing the symlink itself.
The submodule_git_url
identifies the location of the submodule repository, and the sha
identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit.
If the submodule repository is not hosted on github.com, the Git URLs (git_url
and _links["git"]
) and the github.com URLs (html_url
and _links["html"]
) will have null values.
octokit.repos.getContent({owner,repo,path,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
path | yes | path+ parameter |
ref | no | The name of the commit/branch/tag. Default: the repository’s default branch (usually |
See also: GitHub Developer Guide documentation.
Returns the total
number of commits authored by the contributor. In addition, the response includes a Weekly Hash (weeks
array) with the following information:
w
- Start of the week, given as a Unix timestamp.a
- Number of additionsd
- Number of deletionsc
- Number of commitsoctokit.repos.getContributorsStats({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.getDeployKey({owner,repo,key_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
key_id | yes | key_id parameter |
See also: GitHub Developer Guide documentation.
octokit.repos.getDeployment({owner,repo,deployment_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
deployment_id | yes | deployment_id parameter |
See also: GitHub Developer Guide documentation.
Users with pull access can view a deployment status for a deployment:
octokit.repos.getDeploymentStatus({owner,repo,deployment_id,status_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
deployment_id | yes | deployment_id parameter |
status_id | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.getLatestPagesBuild({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
View the latest published full release for the repository.
The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at
attribute. The created_at
attribute is the date of the commit used for the release, and not the date when the release was drafted or published.
octokit.repos.getLatestRelease({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.getPages({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.getPagesBuild({owner,repo,build_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
build_id | yes |
See also: GitHub Developer Guide documentation.
Returns the total commit counts for the owner
and total commit counts in all
. all
is everyone combined, including the owner
in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract owner
from all
.
The array order is oldest week (index 0) to most recent week.
octokit.repos.getParticipationStats({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.getPullRequestReviewProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Each array contains the day number, hour number, and number of commits:
0-6
: Sunday - Saturday0-23
: Hour of dayFor example, [2, 14, 25]
indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.
octokit.repos.getPunchCardStats({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Gets the preferred README for a repository.
READMEs support custom media types for retrieving the raw content or rendered HTML.
octokit.repos.getReadme({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | no | The name of the commit/branch/tag. Default: the repository’s default branch (usually |
See also: GitHub Developer Guide documentation.
Note: This returns an upload_url
key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource.
octokit.repos.getRelease({owner,repo,release_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
release_id | yes | release_id parameter |
See also: GitHub Developer Guide documentation.
To download the asset's binary content, set the Accept
header of the request to application/octet-stream
. The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a 200
or 302
response.
octokit.repos.getReleaseAsset({owner,repo,asset_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
asset_id | yes | asset_id parameter |
See also: GitHub Developer Guide documentation.
Get a published release with the specified tag.
octokit.repos.getReleaseByTag({owner,repo,tag,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
tag | yes | tag+ parameter |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.getStatusChecksProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Lists the teams who have push access to this branch. The list includes child teams.
octokit.repos.getTeamsWithAccessToProtectedBranch({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Get the top 10 popular contents over the last 14 days.
octokit.repos.getTopPaths({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Get the top 10 referrers over the last 14 days.
octokit.repos.getTopReferrers({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Lists the people who have push access to this branch.
octokit.repos.getUsersWithAccessToProtectedBranch({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
octokit.repos.getViews({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per | no | Must be one of: |
See also: GitHub Developer Guide documentation.
Returns a webhook configured in a repository. To get only the webhook config
properties, see "Get a webhook configuration for a repository."
octokit.repos.getWebhook({owner,repo,hook_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
Returns the webhook configuration for a repository. To get more information about the webhook, including the active
state and events
, use "Get a repository webhook."
Access tokens must have the read:repo_hook
or repo
scope, and GitHub Apps must have the repository_hooks:read
permission.
octokit.repos.getWebhookConfigForRepo({owner,repo,hook_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.listBranches({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
protected | no | Setting to |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.
octokit.repos.listBranchesForHeadCommit({owner,repo,commit_sha,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
commit_sha | yes | commit_sha parameter |
See also: GitHub Developer Guide documentation.
For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.
Team members will include the members of child teams.
octokit.repos.listCollaborators({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
affiliation | no | Filter collaborators returned by their affiliation. Can be one of: |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Use the :commit_sha
to specify the commit that will have its comments listed.
octokit.repos.listCommentsForCommit({owner,repo,commit_sha,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
commit_sha | yes | commit_sha parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Commit Comments use these custom media types. You can read more about the use of media types in the API here.
Comments are ordered by ascending ID.
octokit.repos.listCommitCommentsForRepo({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit's signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified | boolean | Indicates whether GitHub considers the signature in this commit to be verified. |
reason | string | The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature | string | The signature that was extracted from the commit. |
payload | string | The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key | The key that made the signature is expired. |
not_signing_key | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error | There was an error communicating with the signature verification service. |
gpgverify_unavailable | The signature verification service is currently unavailable. |
unsigned | The object does not include a signature. |
unknown_signature_type | A non-PGP signature was found in the commit. |
no_user | No user was associated with the committer email address in the commit. |
unverified_email | The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email | The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key | The key that made the signature has not been registered with any user's account. |
malformed_signature | There was an error parsing the signature. |
invalid | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid | None of the above errors applied, so the signature is considered to be verified. |
octokit.repos.listCommits({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
sha | no | SHA or branch to start listing commits from. Default: the repository’s default branch (usually |
path | no | Only commits containing this file path will be returned. |
author | no | GitHub login or email address by which to filter by commit author. |
since | no | Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: |
until | no | Only commits before this date will be returned. This is a timestamp in ISO 8601 format: |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.
This resource is also available via a legacy route: GET /repos/:owner/:repo/statuses/:ref
.
octokit.repos.listCommitStatusesForRef({owner,repo,ref,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
ref | yes | ref+ parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance.
GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.
octokit.repos.listContributors({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
anon | no | Set to |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
octokit.repos.listDeployKeys({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Simple filtering of deployments is available via query parameters:
octokit.repos.listDeployments({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
sha | no | The SHA recorded at creation time. |
ref | no | The name of the ref. This can be a branch, tag, or SHA. |
task | no | The name of the task for the deployment (e.g., |
environment | no | The name of the environment that was deployed to (e.g., |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Users with pull access can view deployment statuses for a deployment:
octokit.repos.listDeploymentStatuses({owner,repo,deployment_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
deployment_id | yes | deployment_id parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Lists repositories that the authenticated user has explicit permission (:read
, :write
, or :admin
) to access.
The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
octokit.repos.listForAuthenticatedUser();
name | required | description |
---|---|---|
visibility | no | Can be one of |
affiliation | no | Comma-separated list of values. Can include: |
type | no | Can be one of Will cause a |
sort | no | Can be one of |
direction | no | Can be one of |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
since | no | Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: |
before | no | Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: |
See also: GitHub Developer Guide documentation.
octokit.repos.listForks({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
sort | no | The sort order. Can be either |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Lists repositories for the specified organization.
octokit.repos.listForOrg({org,});
name | required | description |
---|---|---|
org | yes | |
type | no | Specifies the types of repositories you want returned. Can be one of |
sort | no | Can be one of |
direction | no | Can be one of |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Lists public repositories for the specified user.
octokit.repos.listForUser({username,});
name | required | description |
---|---|---|
username | yes | |
type | no | Can be one of |
sort | no | Can be one of |
direction | no | Can be one of |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.
octokit.repos.listInvitations({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
When authenticating as a user, this endpoint will list all currently open repository invitations for that user.
octokit.repos.listInvitationsForAuthenticatedUser();
name | required | description |
---|---|---|
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language.
octokit.repos.listLanguages({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.listPagesBuilds({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
Lists all public repositories in the order that they were created.
Note: Pagination is powered exclusively by the since
parameter. Use the Link header to get the URL for the next page of repositories.
octokit.repos.listPublic();
name | required | description |
---|---|---|
since | no | A repository ID. Only return repositories with an ID greater than this ID. |
See also: GitHub Developer Guide documentation.
Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the List pull requests endpoint.
octokit.repos.listPullRequestsAssociatedWithCommit({owner,repo,commit_sha,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
commit_sha | yes | commit_sha parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
octokit.repos.listReleaseAssets({owner,repo,release_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
release_id | yes | release_id parameter |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the Repository Tags API.
Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.
octokit.repos.listReleases({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
octokit.repos.listTags({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
octokit.repos.listTeams({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
octokit.repos.listWebhooks({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
per_page | no | Results per page (max 100) |
page | no | Page number of the results to fetch. |
See also: GitHub Developer Guide documentation.
octokit.repos.merge({owner,repo,base,head,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
base | yes | The name of the base branch that the head will be merged into. |
head | yes | The head to merge. This can be a branch name or a commit SHA1. |
commit_message | no | Commit message to use for the merge commit. If omitted, a default message will be used. |
See also: GitHub Developer Guide documentation.
This will trigger a ping event to be sent to the hook.
octokit.repos.pingWebhook({owner,repo,hook_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Removes the ability of an app to push to this branch. Only installed GitHub Apps with write
access to the contents
permission can be added as authorized actors on a protected branch.
Type | Description |
---|---|
array | The GitHub Apps that have push access to this branch. Use the app's slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.removeAppAccessRestrictions({owner,repo,branch,apps,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
apps | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.removeCollaborator({owner,repo,username,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
username | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.removeStatusCheckContexts({owner,repo,branch,contexts,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
contexts | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.removeStatusCheckProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Removes the ability of a team to push to this branch. You can also remove push access for child teams.
Type | Description |
---|---|
array | Teams that should no longer have push access. Use the team's slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.removeTeamAccessRestrictions({owner,repo,branch,teams,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
teams | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Removes the ability of a user to push to this branch.
Type | Description |
---|---|
array | Usernames of the people who should no longer have push access. Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.removeUserAccessRestrictions({owner,repo,branch,users,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
users | yes |
See also: GitHub Developer Guide documentation.
Renames a branch in a repository.
Note: Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "Renaming a branch".
The permissions required to use this endpoint depends on whether you are renaming the default branch.
To rename a non-default branch:
contents:write
repository permission.To rename the default branch:
administration:write
repository permission.octokit.repos.renameBranch({owner,repo,branch,new_name,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
new_name | yes | The new name of the branch. |
See also: GitHub Developer Guide documentation.
octokit.repos.replaceAllTopics({owner,repo,names,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
names | yes | An array of topics to add to the repository. Pass one or more topics to replace the set of existing topics. Send an empty array ( |
See also: GitHub Developer Guide documentation.
You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.
Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.
octokit.repos.requestPagesBuild({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
octokit.repos.setAdminBranchProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with write
access to the contents
permission can be added as authorized actors on a protected branch.
Type | Description |
---|---|
array | The GitHub Apps that have push access to this branch. Use the app's slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.setAppAccessRestrictions({owner,repo,branch,apps,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
apps | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
octokit.repos.setStatusCheckContexts({owner,repo,branch,contexts,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
contexts | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.
Type | Description |
---|---|
array | The teams that can have push access. Use the team's slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.setTeamAccessRestrictions({owner,repo,branch,teams,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
teams | yes |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.
Type | Description |
---|---|
array | Usernames for people who can have push access. Note: The list of users, apps, and teams in total is limited to 100 items. |
octokit.repos.setUserAccessRestrictions({owner,repo,branch,users,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
users | yes |
See also: GitHub Developer Guide documentation.
This will trigger the hook with the latest push to the current repository if the hook is subscribed to push
events. If the hook is not subscribed to push
events, the server will respond with 204 but no test POST will be generated.
Note: Previously /repos/:owner/:repo/hooks/:hook_id/test
octokit.repos.testPushWebhook({owner,repo,hook_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
hook_id | yes |
See also: GitHub Developer Guide documentation.
A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original owner
, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see about repository transfers.
octokit.repos.transfer({owner,repo,new_owner,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
new_owner | yes | The username or organization name the repository will be transferred to. |
team_ids | no | ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. |
See also: GitHub Developer Guide documentation.
Note: To edit a repository's topics, use the Replace all repository topics endpoint.
octokit.repos.update({owner,repo,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
name | no | The name of the repository. |
description | no | A short description of the repository. |
homepage | no | A URL with more information about the repository. |
private | no | Either |
visibility | no | Can be |
has_issues | no | Either |
has_projects | no | Either |
has_wiki | no | Either |
is_template | no | Either |
default_branch | no | Updates the default branch for this repository. |
allow_squash_merge | no | Either |
allow_merge_commit | no | Either |
allow_rebase_merge | no | Either |
delete_branch_on_merge | no | Either |
archived | no |
|
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Protecting a branch requires admin or owner permissions to the repository.
Note: Passing new arrays of users
and teams
replaces their previous values.
Note: The list of users, apps, and teams in total is limited to 100 items.
octokit.repos.updateBranchProtection({owner,repo,branch,required_status_checks,required_status_checks.strict,required_status_checks.contexts,enforce_admins,required_pull_request_reviews,restrictions,restrictions.users,restrictions.teams})
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
required_status_checks | yes | Require status checks to pass before merging. Set to |
required_status_checks.strict | yes | Require branches to be up to date before merging. |
required_status_checks.contexts | yes | The list of status checks to require in order to merge into this branch |
enforce_admins | yes | Enforce all configured restrictions for administrators. Set to |
required_pull_request_reviews | yes | Require at least one approving review on a pull request, before merging. Set to |
required_pull_request_reviews.dismissal_restrictions | no | Specify which users and teams can dismiss pull request reviews. Pass an empty |
required_pull_request_reviews.dismissal_restrictions.users | no | The list of user |
required_pull_request_reviews.dismissal_restrictions.teams | no | The list of team |
required_pull_request_reviews.dismiss_stale_reviews | no | Set to |
required_pull_request_reviews.require_code_owner_reviews | no | Blocks merging pull requests until code owners review them. |
required_pull_request_reviews.required_approving_review_count | no | Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6. |
restrictions | yes | Restrict who can push to the protected branch. User, app, and team |
restrictions.users | yes | The list of user |
restrictions.teams | yes | The list of team |
restrictions.apps | no | The list of app |
required_linear_history | no | Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to |
allow_force_pushes | no | Permits force pushes to the protected branch by anyone with write access to the repository. Set to |
allow_deletions | no | Allows deletion of the protected branch by anyone with write access to the repository. Set to |
See also: GitHub Developer Guide documentation.
octokit.repos.updateCommitComment({owner,repo,comment_id,body,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
comment_id | yes | comment_id parameter |
body | yes | The contents of the comment |
See also: GitHub Developer Guide documentation.
Updates information for a GitHub Pages site. For more information, see "About GitHub Pages.
octokit.repos.updateInformationAboutPagesSite({owner,repo,source,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
cname | no | Specify a custom domain for the repository. Sending a |
public | no | Configures access controls for the GitHub Pages site. If public is set to |
source | yes |
See also: GitHub Developer Guide documentation.
octokit.repos.updateInvitation({owner,repo,invitation_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
invitation_id | yes | invitation_id parameter |
permissions | no | The permissions that the associated user will have on the repository. Valid values are |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
Note: Passing new arrays of users
and teams
replaces their previous values.
octokit.repos.updatePullRequestReviewProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
dismissal_restrictions | no | Specify which users and teams can dismiss pull request reviews. Pass an empty |
dismissal_restrictions.users | no | The list of user |
dismissal_restrictions.teams | no | The list of team |
dismiss_stale_reviews | no | Set to |
require_code_owner_reviews | no | Blocks merging pull requests until code owners have reviewed. |
required_approving_review_count | no | Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6. |
See also: GitHub Developer Guide documentation.
Users with push access to the repository can edit a release.
octokit.repos.updateRelease({owner,repo,release_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
release_id | yes | release_id parameter |
tag_name | no | The name of the tag. |
target_commitish | no | Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually |
name | no | The name of the release. |
body | no | Text describing the contents of the tag. |
draft | no |
|
prerelease | no |
|
See also: GitHub Developer Guide documentation.
Users with push access to the repository can edit a release asset.
octokit.repos.updateReleaseAsset({owner,repo,asset_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
asset_id | yes | asset_id parameter |
name | no | The file name of the asset. |
label | no | An alternate short description of the asset. Used in place of the filename. |
state | no |
See also: GitHub Developer Guide documentation.
Deprecated: This method has been renamed to repos.updateStatusCheckProtection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.
octokit.repos.updateStatusCheckPotection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
strict | no | Require branches to be up to date before merging. |
contexts | no | The list of status checks to require in order to merge into this branch |
See also: GitHub Developer Guide documentation.
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.
octokit.repos.updateStatusCheckProtection({owner,repo,branch,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
branch | yes | The name of the branch. |
strict | no | Require branches to be up to date before merging. |
contexts | no | The list of status checks to require in order to merge into this branch |
See also: GitHub Developer Guide documentation.
Updates a webhook configured in a repository. If you previously had a secret
set, you must provide the same secret
or set a new secret
or the secret will be removed. If you are only updating individual webhook config
properties, use "Update a webhook configuration for a repository."
octokit.repos.updateWebhook({owner,repo,hook_id,config.url})
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
hook_id | yes | |
config | no | Key/value pairs to provide settings for this webhook. These are defined below. |
config.url | yes | The URL to which the payloads will be delivered. |
config.content_type | no | The media type used to serialize the payloads. Supported values include |
config.secret | no | If provided, the |
config.insecure_ssl | no | Determines whether the SSL certificate of the host for |
config.address | no | |
config.room | no | |
events | no | Determines what events the hook is triggered for. This replaces the entire array of events. |
add_events | no | Determines a list of events to be added to the list of events that the Hook triggers for. |
remove_events | no | Determines a list of events to be removed from the list of events that the Hook triggers for. |
active | no | Determines if notifications are sent when the webhook is triggered. Set to |
See also: GitHub Developer Guide documentation.
Updates the webhook configuration for a repository. To update more information about the webhook, including the active
state and events
, use "Update a repository webhook."
Access tokens must have the write:repo_hook
or repo
scope, and GitHub Apps must have the repository_hooks:write
permission.
octokit.repos.updateWebhookConfigForRepo({owner,repo,hook_id,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
hook_id | yes | |
url | no | The URL to which the payloads will be delivered. |
content_type | no | The media type used to serialize the payloads. Supported values include |
secret | no | If provided, the |
insecure_ssl | no | Determines whether the SSL certificate of the host for |
See also: GitHub Developer Guide documentation.
This endpoint makes use of a Hypermedia relation to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the upload_url
returned in the response of the Create a release endpoint to upload a release asset.
You need to use an HTTP client which supports SNI to make calls to this endpoint.
Most libraries will set the required Content-Length
header automatically. Use the required Content-Type
header to provide the media type of the asset. For a list of media types, see Media Types. For example:
application/zip
GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset.
When an upstream failure occurs, you will receive a 502 Bad Gateway
status. This may leave an empty asset with a state of starter
. It can be safely deleted.
Notes:
octokit.repos.uploadReleaseAsset({owner,repo,release_id,data,});
name | required | description |
---|---|---|
owner | yes | |
repo | yes | |
release_id | yes | release_id parameter |
name | no | |
label | no | |
data | yes | The raw file data |
origin | no | The URL origin (protocol + host name + port) is included in |
See also: GitHub Developer Guide documentation.