PATCH /repos/{owner}/{repo}

Note: To edit a repository's topics, use the Replace all repository topics endpoint.

Servers

Path parameters

Name Type Required Description
repo String Yes

The name of the repository without the .git extension. The name is not case sensitive.

owner String Yes

The account owner of the repository. The name is not case sensitive.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
description String No

A short description of the repository.

merge_commit_message String No

The default value for a merge commit message.

  • PR_TITLE - default to the pull request's title.
  • PR_BODY - default to the pull request's body.
  • BLANK - default to a blank commit message.

Possible values:

  • "BLANK"
  • "PR_BODY"
  • "PR_TITLE"
security_and_analysis Object No

Specify which security and analysis features to enable or disable for the repository.

To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "Managing security managers in your organization."

For example, to enable GitHub Advanced Security, use this data in the body of the PATCH request: { "security_and_analysis": {"advanced_security": { "status": "enabled" } } }.

You can check which security and analysis features are currently enabled by using a GET /repos/{owner}/{repo} request.

security_and_analysis.secret_scanning Object No

Use the status property to enable or disable secret scanning for this repository. For more information, see "About secret scanning."

security_and_analysis.secret_scanning.status String No

Can be enabled or disabled.

security_and_analysis.secret_scanning_non_provider_patterns Object No

Use the status property to enable or disable secret scanning non-provider patterns for this repository. For more information, see "Supported secret scanning patterns."

security_and_analysis.secret_scanning_non_provider_patterns.status String No

Can be enabled or disabled.

security_and_analysis.advanced_security Object No

Use the status property to enable or disable GitHub Advanced Security for this repository. For more information, see "About GitHub Advanced Security."

security_and_analysis.advanced_security.status String No

Can be enabled or disabled.

security_and_analysis.secret_scanning_ai_detection Object No

Use the status property to enable or disable secret scanning AI detection for this repository. For more information, see "Responsible detection of generic secrets with AI."

security_and_analysis.secret_scanning_ai_detection.status String No

Can be enabled or disabled.

security_and_analysis.secret_scanning_push_protection Object No

Use the status property to enable or disable secret scanning push protection for this repository. For more information, see "Protecting pushes with secret scanning."

security_and_analysis.secret_scanning_push_protection.status String No

Can be enabled or disabled.

security_and_analysis.code_security Object No

Use the status property to enable or disable GitHub Code Security for this repository.

security_and_analysis.code_security.status String No

Can be enabled or disabled.

has_wiki Boolean No

Either true to enable the wiki for this repository or false to disable it.

Default value: true

merge_commit_title String No

Required when using merge_commit_message.

The default value for a merge commit title.

  • PR_TITLE - default to the pull request's title.
  • MERGE_MESSAGE - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).

Possible values:

  • "PR_TITLE"
  • "MERGE_MESSAGE"
is_template Boolean No

Either true to make this repo available as a template repository or false to prevent it.

Default value: false

default_branch String No

Updates the default branch for this repository.

allow_rebase_merge Boolean No

Either true to allow rebase-merging pull requests, or false to prevent rebase-merging.

Default value: true

web_commit_signoff_required Boolean No

Either true to require contributors to sign off on web-based commits, or false to not require contributors to sign off on web-based commits.

Default value: false

has_projects Boolean No

Either true to enable projects for this repository or false to disable them. Note: If you're creating a repository in an organization that has disabled repository projects, the default is false, and if you pass true, the API returns an error.

Default value: true

allow_update_branch Boolean No

Either true to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise.

Default value: false

use_squash_pr_title_as_default Boolean No

Either true to allow squash-merge commits to use pull request title, or false to use commit message. **This property is closing down. Please use squash_merge_commit_title instead.

Default value: false

archived Boolean No

Whether to archive this repository. false will unarchive a previously archived repository.

Default value: false

squash_merge_commit_message String No

The default value for a squash merge commit message:

  • PR_BODY - default to the pull request's body.
  • COMMIT_MESSAGES - default to the branch's commit messages.
  • BLANK - default to a blank commit message.

Possible values:

  • "BLANK"
  • "PR_BODY"
  • "COMMIT_MESSAGES"
has_issues Boolean No

Either true to enable issues for this repository or false to disable them.

Default value: true

squash_merge_commit_title String No

Required when using squash_merge_commit_message.

The default value for a squash merge commit title:

  • PR_TITLE - default to the pull request's title.
  • COMMIT_OR_PR_TITLE - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).

Possible values:

  • "PR_TITLE"
  • "COMMIT_OR_PR_TITLE"
allow_squash_merge Boolean No

Either true to allow squash-merging pull requests, or false to prevent squash-merging.

Default value: true

delete_branch_on_merge Boolean No

Either true to allow automatically deleting head branches when pull requests are merged, or false to prevent automatic deletion.

Default value: false

visibility String No

The visibility of the repository.

Possible values:

  • "public"
  • "private"
homepage String No

A URL with more information about the repository.

name String No

The name of the repository.

allow_forking Boolean No

Either true to allow private forks, or false to prevent private forks.

Default value: false

allow_auto_merge Boolean No

Either true to allow auto-merge on pull requests, or false to disallow auto-merge.

Default value: false

private Boolean No

Either true to make the repository private or false to make it public. Default: false.
Note: You will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private.

Default value: false

allow_merge_commit Boolean No

Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits.

Default value: true

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.