Files
exo/.github/workflows/format.yml
2025-06-17 05:46:33 +01:00

49 lines
1.0 KiB
YAML

name: format
on:
push:
branches:
- staging
- main
pull_request:
branches:
- staging
- main
jobs:
format:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install Python
run: uv python install
- name: Sync dependencies
run: uv sync --locked --all-extras --dev
- name: Format code
run: uv run poe fmt
- name: Push formatted code
run: |
git diff --quiet && exit 0
git config --local user.email "github-actions@users.noreply.github.com"
git config --local user.name "github-actions bot"
git commit -am "chore(format)"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}