Skip to content

Commit

Permalink
feat(poetry-djlint): introduce poetry-djlint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Jun 22, 2023
1 parent 20ca40e commit afcd423
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/poetry-djlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#SPDX-FileCopyrightText: 2023 Birger Schacht
#SPDX-License-Identifier: MIT
name: Run djlint linter via poetry

on:
workflow_call:
inputs:
python-version:
required: false
type: string
default: "3.11"
src:
required: true
type: string
options:
required: false
type: string
default: "--check"

jobs:
djlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# for poetry caching, we have to install poetry before setting up python
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
cache: 'poetry'
cache-dependency-path: "pyproject.toml"
python-version: ${{ inputs.python-version }}
- name: Install dev dependencies
run: |
poetry install --no-root --no-directory --only dev
- name: Run djlint
run: |
poetry run djlint ${{inputs.options}} ${{inputs.src}}

0 comments on commit afcd423

Please sign in to comment.