Refactor/endpoints #18
Workflow file for this run
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: Ruff format | |
| on: | |
| workflow_dispatch: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: write | |
| jobs: | |
| check-formatting: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.12] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Ruff | |
| run: pip install ruff | |
| - name: Run Ruff formatter | |
| run: ruff format . | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "${{ secrets.RUFF_USER_NAME }}" | |
| git config user.email "${{ secrets.RUFF_EMAIL }}" | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| git add -A | |
| git commit -m "Run Ruff format" | |
| git push | |
| else | |
| echo "No formatting changes detected." | |
| fi |