diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/format.yaml | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 0bb870106..9e165e0e8 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml | |||
| @@ -19,7 +19,9 @@ jobs: | |||
| 19 | container: qmkfm/qmk_cli | 19 | container: qmkfm/qmk_cli |
| 20 | 20 | ||
| 21 | steps: | 21 | steps: |
| 22 | - uses: rlespinasse/github-slug-action@v3.x | 22 | - name: Install dependencies |
| 23 | run: | | ||
| 24 | apt-get update && apt-get install -y dos2unix | ||
| 23 | 25 | ||
| 24 | - uses: actions/checkout@v2 | 26 | - uses: actions/checkout@v2 |
| 25 | with: | 27 | with: |
| @@ -31,12 +33,17 @@ jobs: | |||
| 31 | output: ' ' | 33 | output: ' ' |
| 32 | fileOutput: ' ' | 34 | fileOutput: ' ' |
| 33 | 35 | ||
| 34 | - name: Run qmk format-c and qmk format-python | 36 | - name: Run qmk formatters |
| 35 | shell: 'bash {0}' | 37 | shell: 'bash {0}' |
| 36 | run: | | 38 | run: | |
| 37 | qmk format-c --core-only -n $(< ~/files.txt) | 39 | qmk format-c --core-only $(< ~/files.txt) |
| 38 | format_c_exit=$? | 40 | qmk format-python |
| 39 | qmk format-python -n | 41 | qmk format-text $(< ~/files.txt) |
| 40 | format_python_exit=$? | 42 | git diff |
| 41 | 43 | ||
| 42 | exit $((format_c_exit + format_python_exit)) | 44 | - name: Fail when formatting required |
| 45 | run: | | ||
| 46 | for file in $(git diff --name-only); do | ||
| 47 | echo "::error file=${file}::::File Requires Formatting" | ||
| 48 | done | ||
| 49 | test -z "$(git diff --name-only)" | ||
