Skip to content

Approve Python Formatting Changes

Approve PRs that only contain formatting changes to Python files.

Approve Python Formatting Changes

Configuration Description

Conditions (all must be true):

  • All of the files end in .py.
  • All changes are non-functional

Automation Actions:

  • Approve the PR
  • Apply a code-formatting label.
  • Post a comment that explains the automation.

Approve Python Formatting Changes

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  approve_python_formatting:
    if:
      - {{ files | extensions | match(list=['py']) | every }}
      - {{ source.diff.files | isFormattingChange }}
    run:
      - action: approve@v1
      - action: add-label@v1
        args:
          label: code-formatting
      - action: add-comment@v1
        args:
          comment: |
            This PR only contains formatting changes and has been approved.