Skip to content

srun add cmd

srun add cmd #26

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 }}