Update jwt_utils.py #110
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: 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 |