Skip to main content
The repository section configures GitHub repository settings. These settings control repository behavior, features, security, and merge strategies.

Basic Configuration

name
string
Repository name. If not specified, uses the repo field.
description
string
A short description of the repository that will show up on GitHub.
repository:
  description: description of the repo
homepage
string
A URL with more information about the repository.
repository:
  homepage: https://example.github.io/
topics
array
A list of topics to set on the repository.
repository:
  topics:
    - github
    - probot
    - new-topic

Visibility and Privacy

private
boolean
Either true to make the repository private, or false to make it public. If this value is changed and org members cannot change the visibility of repos, it will result in an error.
repository:
  private: true
visibility
string
Can be public, private, or internal. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be internal.
repository:
  visibility: private
archived
boolean
default:"false"
Whether to archive this repository. false will unarchive a previously archived repository.
repository:
  archived: false

Repository Features

has_issues
boolean
Either true to enable issues for this repository, or false to disable them.
repository:
  has_issues: true
has_projects
boolean
Either true to enable projects for this repository, or false to disable them. If projects are disabled for the organization, passing true will cause an API error.
repository:
  has_projects: true
has_wiki
boolean
Either true to enable the wiki for this repository, or false to disable it.
repository:
  has_wiki: true

Branch Configuration

default_branch
string
The default branch for this repository. Safe Settings will rename the branch if it already exists, or create it if it doesn’t exist.
repository:
  default_branch: main

Merge Options

allow_squash_merge
boolean
Either true to allow squash-merging pull requests, or false to prevent squash-merging.
repository:
  allow_squash_merge: true
allow_merge_commit
boolean
Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits.
repository:
  allow_merge_commit: true
allow_rebase_merge
boolean
Either true to allow rebase-merging pull requests, or false to prevent rebase-merging.
repository:
  allow_rebase_merge: true
allow_auto_merge
boolean
default:"false"
Either true to allow auto-merge on pull requests, or false to disallow auto-merge.
repository:
  allow_auto_merge: true
delete_branch_on_merge
boolean
default:"false"
Either true to allow automatically deleting head branches when pull requests are merged, or false to prevent automatic deletion.
repository:
  delete_branch_on_merge: true
allow_update_branch
boolean
default:"false"
Either true to allow update branch on pull requests, or false to disallow update branch.
repository:
  allow_update_branch: true

Security Settings

security
object
Settings for Code security and analysis features.
security.enableVulnerabilityAlerts
boolean
Enable or disable Dependabot alerts for the repository.
security.enableAutomatedSecurityFixes
boolean
Enable or disable Dependabot security updates (automated security fixes) for the repository.
repository:
  security:
    enableVulnerabilityAlerts: true
    enableAutomatedSecurityFixes: true

Repository Creation

force_create
boolean
If set to true, Safe Settings will create the repository if it doesn’t exist. This setting is not sent to the GitHub API.
repository:
  force_create: true
auto_init
boolean
Create an initial commit with empty README. Keep this set to true in most cases since many policies cannot be implemented on bare repos.
repository:
  auto_init: true
template
string
When creating a repository with force_create, use this template repository name. The template must be owned by the same organization.
repository:
  force_create: true
  template: template-repo-name
gitignore_template
string
Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, “Haskell”.
repository:
  gitignore_template: node
license_template
string
Choose an open source license template that best suits your needs, and then use the license keyword as the license_template string. For example, “mit” or “mpl-2.0”.
repository:
  license_template: mit

Complete Example

repository:
  description: description of the repo
  homepage: https://example.github.io/
  auto_init: true
  
  topics:
    - github
    - probot
    - new-topic
  
  security:
    enableVulnerabilityAlerts: true
    enableAutomatedSecurityFixes: true
  
  private: true
  visibility: private
  has_issues: true
  has_projects: true
  has_wiki: true
  
  default_branch: main
  
  allow_squash_merge: true
  allow_merge_commit: true
  allow_rebase_merge: true
  allow_auto_merge: true
  delete_branch_on_merge: true
  allow_update_branch: true
  
  archived: false

API Reference

For more details, see GitHub’s REST API documentation:

Build docs developers (and LLMs) love