diff --git a/.github/workflows/run-djlint.yml b/.github/workflows/run-djlint.yml new file mode 100644 index 000000000..7740d3c34 --- /dev/null +++ b/.github/workflows/run-djlint.yml @@ -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 }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index a1189dd7c..464307b29 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ requirements.txt *.code-workspace *.log *.exe +poetry.lock