Skip to content

Update jwt_utils.py #110

Update jwt_utils.py

Update jwt_utils.py #110

name: Format code using Ruff and push it back to the branch
on:
push:
branches:
- '*' # Trigger on all branches
jobs:
format:
name: Format with Ruff
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref || github.ref_name }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Ruff
run: pip install ruff
- name: Run Ruff to format and fix lint
run: |
ruff format .
ruff check --fix .
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if ! git diff --quiet; then
git add .
git commit -m "Apply Ruff formatting"
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
git push origin HEAD:$BRANCH
fi