Skip to content

GitHub Configuration

Configuration used by the Sourcery GitHub bot, specified in the .sourcery.yaml file (parent reference).

Fields Overview

All fields are optional.

Field Type Description
ignore_labels list of string List of labels for which the Sourcery GitHub bot will ignore pull requests.
labels list of string List of labels the Sourcery GitHub bot will attach to its pull requests.
request_review string OR object Person or organisation the Sourcery GitHub bot will request a review from.
sourcery_branch string Template for the name the Sourcery GitHub bot will give its branches.

Default

github:
  ignore_labels:
    - sourcery-ignore
  request_review: author
  sourcery_branch: sourcery/{base_branch}

Complete Example

github:
  ignore_labels:
    - sourcery-ignore
  labels:
    - build-ignore
  request_review:
    origin: owner
    forked: author
  sourcery_branch: sourcery/refactor/{base_branch}

Fields

ignore_labels

list of string

The Sourcery GitHub bot will ignore any pull request labeled with any label in ignore_labels.

Default

github:
  ignore_labels:
    - sourcery-ignore

Example

github:
  ignore_labels:
    - docs

labels

list of string

The Sourcery GitHub bot will automatically attach these labels to any pull request it makes.

Default

(Empty list)

Example

github:
  labels:
    - build-ignore
    - sourcery

request_review

string OR object

The Sourcery GitHub bot will automatically request reviews from the user specified by request_review. This person can be:

  • author - the author of the original pull request (default)
  • none - no review is requested
  • owner - the owner of the repository (invalid for organisations)
  • <user name> - a specific user
  • <organisation>/<team name> - a specific team within an organisation

Default

github:
  review_requests: author

Example

Username example:

github:
  review_requests: player_unknown

Team organisation:

github:
  review_requests: sourcery-ai/developers
Extra: Origin and Forked Pull Requests

Sourcery can be configured to request different reviewers depending on the source of the pull request.

github:
  review_requests:
    origin: owner
    forked: author

sourcery_branch

string

The default name for the branch the Sourcery GitHub bot will create for its pull requests.

This setting must contain {base_branch} which will be replaced with the branch name of the original pull request.

Default

github:
  sourcery_branch: sourcery/{base_branch}

Example

github:
  sourcery_branch: sourcery-refactored/{base_branch}