Add tox -e lint
to GHA
#1
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: Autoformat code and metadata | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
run-and-apply: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Install dependencies | |
run: pip install --upgrade pip setuptools wheel "tox<4.0.0" | |
- name: Permission workaround | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Run formatter | |
run: tox -e lint | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'Commit automated formatter changes' | |
add: '.' |