Skip to content

Commit

Permalink
precommit tested
Browse files Browse the repository at this point in the history
  • Loading branch information
krrish-sehgal committed Nov 5, 2024
2 parents 122e701 + 45376c4 commit b197a79
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/run-djlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run djlint

on:
workflow_dispatch:

permissions:
contents: write

jobs:
run-djlint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install djlint
run: |
python -m venv venv
source venv/bin/activate
pip install djlint
- 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: 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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ requirements.txt
*.code-workspace
*.log
*.exe
poetry.lock

0 comments on commit b197a79

Please sign in to comment.