/hooky

Productivity tools for popular open source repos, used by pydantic

Primary LanguagePythonMIT LicenseMIT

Hooky

CI Coverage license

Receive and respond to GitHub webhooks, built for use with pydantic.

Label and Assign

This tool responds to magic phrases in pull request comments:

  • "please update" - requests an update from the PR author, the PR author is assigned and the "awaiting author revision" label is added
  • "please review" - requests a review from project reviewers, the reviewers are assigned and the "ready for review" label is added

Change File Checks

This tool checks pull requests to enforce a "change file" has been added.

See here for details on the format expected.

To skip this check the magic phrase "skip change file check" can be added to the pull request body.

Otherwise, the following checks are performed on the pull request:

  • A change file matching changes/<ID>-<author>.md has been added
  • The author in the change file matches the PR author
  • The ID in the change file either matches the PR ID or that issue is marked as closed in the PR body

Configuration

Hooky is configured via a TOML file in the root of the repository.

Either .hooky.toml (takes priority) or pyproject.toml can be used, either way the configuration should be under the [tool.hooky] table.

The following configuration options are available, here they're filled with the default values:

[tool.hooky]
reviewers = []  # see below for details on behaviour
request_update_trigger = 'please update'
request_review_trigger = 'please review'
awaiting_update_label = 'awaiting author revision'
awaiting_review_label = 'ready for review'
no_change_file = 'skip change file check'
require_change_file = true

Note: if reviewers is empty (the default), all repo collaborators are collected from /repos/{owner}/{repo}/collaborators.

Example configuration

For example to configure one reviewer and change the "No change file required" magic sentence, the following configuration could be used:

reviewers = ['octocat']
no_change_file = 'no change file required'