Skip to content

Only validate release version on non-PR publish builds #25

Only validate release version on non-PR publish builds

Only validate release version on non-PR publish builds #25

Workflow file for this run

name: Black autoformat
on:
push:
branches:
- "**"
paths:
- "ultraplot/**.py"
- "ultraplot/**.pyi"
- ".github/workflows/black.yml"
- ".pre-commit-config.yaml"
- "pyproject.toml"
permissions:
contents: write
concurrency:
group: black-${{ github.ref }}
cancel-in-progress: false
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.ref_name }}
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install Black
run: python -m pip install black==26.5.1
- name: Format Python files
run: black ultraplot
- name: Commit formatting changes
run: |
if git diff --quiet -- '*.py' '*.pyi'; then
echo "Black made no changes."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --update -- '*.py' '*.pyi'
git commit -m "Apply Black formatting"
git push