Files
rise-cook/.github/workflows/autofix.yml
T
Acid 374972ae21
autofix / autofix (push) Has been cancelled
modified: .github/workflows/autofix.yml
new file:   .github/workflows/pyproject.toml
2026-05-23 17:06:45 -04:00

48 lines
1.2 KiB
YAML

name: autofix
on:
push:
branches: ["**"]
permissions:
contents: write
jobs:
autofix:
runs-on: ubuntu-latest
# skip if the last push was already made by this workflow to avoid loops
if: github.actor != 'github-actions[bot]'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install tools
run: uv tool install ruff && uv tool install codespell
- name: ruff import sort
run: ruff check --select I --fix --config .github/workflows/pyproject.toml .
- name: ruff format
run: ruff format --config .github/workflows/pyproject.toml .
- name: codespell
run: codespell --write-changes
- name: Amend commit with fixes
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 --cached --quiet; then
echo "Nothing to fix, skipping."
else
git commit --amend --no-edit
git push --force-with-lease
fi