b11b43fc2a
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
43 lines
917 B
YAML
43 lines
917 B
YAML
name: style
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
style:
|
|
name: style
|
|
runs-on: ubuntu-latest
|
|
environment: style
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install ruff
|
|
run: pip install ruff
|
|
|
|
- name: Run ruff fix
|
|
run: ruff check --fix . || true
|
|
|
|
- name: Commit changes
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add -A
|
|
if git diff --staged --quiet; then
|
|
echo "No changes to commit"
|
|
else
|
|
git commit -m "style: auto-fix ruff warnings [skip ci]"
|
|
git push
|
|
fi
|