Merge pull request #35 from amq92/slurm-test #25
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: Format with Ruff | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref || github.ref_name }} # Ensures the correct branch is checked out | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Ruff | |
run: pip install ruff | |
- name: Run Ruff | |
uses: astral-sh/ruff-action@v3 | |
with: | |
args: "format" | |
- name: Commit fixes (if any) | |
if: success() | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Apply ruff fixes" || echo "No fixes to commit" | |
git push origin HEAD:${{ github.head_ref || github.ref_name }} |