Skip to content

Commit

Permalink
Update run-djlint.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnieBLT authored Nov 9, 2024
1 parent 5121e44 commit 5bbd60d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/run-djlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run djlint
name: Run djlint and Ruff

on:
workflow_dispatch:
Expand All @@ -7,7 +7,7 @@ permissions:
contents: write

jobs:
run-djlint:
lint-and-fix:
runs-on: ubuntu-latest

steps:
Expand All @@ -19,22 +19,27 @@ jobs:
with:
python-version: '3.11'

- name: Install djlint
- name: Install djlint and ruff
run: |
python -m venv venv
source venv/bin/activate
pip install djlint
pip install djlint ruff
- name: Run djlint
run: |
source venv/bin/activate
files_to_check=$(find company/templates website/templates -type f -name "*.html")
djlint --reformat $files_to_check || true
- name: Run Ruff
run: |
source venv/bin/activate
ruff check . --fix || true
- name: Commit changes
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 djlint fixes" || echo "No changes to commit"
git push origin ${{ github.head_ref }}
git commit -m "Apply djlint and Ruff fixes" || echo "No changes to commit"
git push origin ${{ github.head_ref }}

0 comments on commit 5bbd60d

Please sign in to comment.