Fix timing ensure branch is pushed #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ruff | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- 'feature/*' | |
pull_request: | |
branches: | |
- main | |
- master | |
- 'feature/*' | |
jobs: | |
ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Ruff | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/ruff | |
key: ${{ runner.os }}-ruff-${{ hashFiles('**/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-ruff- | |
- name: Run Ruff | |
uses: chartboost/ruff-action@v1 | |
with: | |
args: "check --fix ." # Run `ruff check` with `--fix` on the entire codebase | |
- name: Commit and push changes | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "chore: auto-format code with Ruff" | |
git push | |
fi |