summaryrefslogtreecommitdiff
path: root/.github/workflows/lint.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/lint.yml')
-rw-r--r--.github/workflows/lint.yml20
1 files changed, 15 insertions, 5 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 8e1dbcaea2..67d4093a0b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -22,24 +22,24 @@ jobs:
- name: Install dependencies
run: pip3 install -r requirements-dev.txt
- - uses: trilom/file-changes-action@v1.2.4
+ - name: Get changed files
id: file_changes
- with:
- output: '\n'
+ uses: tj-actions/changed-files@v34
- name: Print info
run: |
git rev-parse --short HEAD
echo ${{ github.event.pull_request.base.sha }}
- echo '${{ steps.file_changes.outputs.files}}'
+ echo '${{ steps.file_changes.outputs.all_changed_files}}'
- name: Run qmk lint
shell: 'bash {0}'
run: |
- QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}')
+ QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.all_changed_files}}' | sed 's/ /\n/g')
QMK_KEYBOARDS=$(qmk list-keyboards)
exit_code=0
+
for KB in $QMK_KEYBOARDS; do
KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)')
if [[ -z "$KEYBOARD_CHANGES" ]]; then
@@ -55,6 +55,16 @@ jobs:
exit_code=$(($exit_code + $?))
fi
done
+
+ qmk format-text ${{ steps.file_changes.outputs.all_changed_files}} || true
+ for file in ${{ steps.file_changes.outputs.all_changed_files}}; do
+ if ! git diff --quiet $file; then
+ echo "File '${file}' Requires Formatting"
+ echo "::error file=${file}::Requires Formatting"
+ exit_code=$(($exit_code + 1))
+ fi
+ done
+
if [[ $exit_code -gt 255 ]]; then
exit 255
fi