mirror of
https://github.com/wger-project/wger.git
synced 2026-12-03 10:34:01 +01:00
42 lines
818 B
YAML
42 lines
818 B
YAML
name: Automatic formatting
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
paths:
|
|
- '**.py'
|
|
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
linting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Get dependencies
|
|
run: pip install ruff
|
|
|
|
- name: Sort the imports
|
|
run: ruff check --fix
|
|
|
|
- name: Format the code
|
|
run: ruff format
|
|
|
|
- name: Push a commit with the changed files
|
|
|
|
# Needed if no files were changed
|
|
continue-on-error: true
|
|
|
|
run: |
|
|
git config user.name git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git add .
|
|
git commit -m "Automatic linting"
|
|
git push
|