Skip to content

Update lint.yaml

Update lint.yaml #2

Workflow file for this run

name: Lint and Auto-Fix Code
on: [push, pull_request]
jobs:
lint_and_fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install black isort flake8
- name: Run black (auto-fix)
run: black .
- name: Run isort (auto-fix)
run: isort .
- name: Run flake8 (lint only)
run: flake8 .
- name: Commit and push changes if needed
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add -A
git diff-index --quiet HEAD || git commit -m 'Apply lint auto-fixes'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}