ci: 💚 fix codecov upload #6
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: Code Formatting and Linting | |
on: [push, pull_request] | |
jobs: | |
format-lint: | |
runs-on: ubuntu-latest | |
outputs: | |
check_changes: ${{ steps.check_changes.outputs.check_changes }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install ruff isort | |
- name: Run isort | |
run: isort . | |
- name: Run Ruff | |
run: ruff . --fix | |
- name: Check for changes | |
id: check_changes | |
run: echo check_changes=$(git status --porcelain) >> $GITHUB_OUTPUT | |
- name: Commit formatting fixes | |
if: steps.check_changes.outputs.check_changes == 'M' | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git commit -a -m "Auto-formatting and linting fixes [skip ci]" | |
git push origin master |