Files
mkdocs/.github/workflows/autofix.yml
Oleh Prypin d6fcc56a3e Set up automatic fixes for PRs using pre-commit-ci-lite (#3561)
If a pull request has applicable Ruff fixes or needs re-formatting with Black/isort, these will be automatically pushed to the pull request via https://pre-commit.ci/lite.html

Versions of these formatter tools are already pinned since commit c9cf11b941, so unexpected unrelated changes from just updating these tools will not happen.

Note that the actual pre-commit tool is not used, and there are no plans for that.
2024-01-29 22:31:12 +01:00

24 lines
678 B
YAML

name: Auto-fix
on:
push:
pull_request:
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
python -m pip install --upgrade hatch
- name: Fix code style
run: hatch run style:fix --fix-only
- name: Check if any edits are necessary
run: git diff --color --exit-code
- name: Apply automatic fixes using pre-commit-ci-lite
if: failure() && github.event_name == 'pull_request'
uses: pre-commit-ci/lite-action@v1.0.1