Secure and Simplify Generic Databrowser Endpoints #26
This file contains hidden or 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: python_lint | |
| on: | |
| push: | |
| branches: "**" | |
| pull_request: | |
| types: [opened, reopened, synchronize, closed] | |
| branches: "**" | |
| jobs: | |
| flake8_py3: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| architecture: x64 | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install lint dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-dev.txt | |
| - name: Check for Python file changes | |
| id: file_check | |
| uses: tj-actions/changed-files@v44 | |
| with: | |
| sha: ${{ github.event.pull_request.head.sha }} | |
| files: | | |
| **.py | |
| - name: Run flake8 | |
| if: steps.file_check.outputs.any_changed == 'true' | |
| run: flake8 --config tox.ini | |
| - name: No Python files changed | |
| if: steps.file_check.outputs.any_changed != 'true' | |
| run: echo "No Python files have been changed." | |
| black_lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install black | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-dev.txt | |
| - name: Check for Python file changes | |
| id: file_check | |
| uses: tj-actions/changed-files@v44 | |
| with: | |
| sha: ${{ github.event.pull_request.head.sha }} | |
| files: '**.py' | |
| - name: Check code lints with Black | |
| if: steps.file_check.outputs.any_changed == 'true' | |
| uses: psf/black@stable | |
| - name: No Python files changed | |
| if: steps.file_check.outputs.any_changed != 'true' | |
| run: echo "No Python files have been changed." |