Sort blogs by vote score #3
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: Check - Templates | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - "templates/**/*.html" | |
| - ".github/workflows/check-templates.yaml" | |
| permissions: | |
| contents: read | |
| jobs: | |
| jinja: | |
| name: Templates | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.13" | |
| - name: Install djLint | |
| run: python -m pip install 'djlint==1.44.2' | |
| - name: Check formatting | |
| id: formatting | |
| run: | | |
| djlint --reformat --profile=jinja templates/ || test $? -eq 1 | |
| git diff -- templates/ > formatting.diff | |
| if [[ -s formatting.diff ]]; then | |
| cat formatting.diff | |
| echo "::error::Template formatting differs. Run: make format-templates" | |
| exit 1 | |
| fi | |
| - name: Upload formatting diff | |
| if: failure() && steps.formatting.outcome == 'failure' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: formatting-diff-${{ github.event.number }}-templates | |
| path: formatting.diff | |
| if-no-files-found: error | |
| retention-days: 7 | |
| - name: Lint | |
| if: success() || steps.formatting.outcome == 'failure' | |
| run: djlint --lint --profile=jinja --ignore=H021 templates/ |