Skip to content

Commit 22bff94

Browse files
committed
format_check: properly export changed files
When multiple files change, tj-action/changed-files separates file names with a space, so the output is ambiguous. Switch to JSON output and use jq to convert the array to a text file with one file name per line, a format that is readily usable for clang-format-action. Signed-off-by: Luca Burelli <[email protected]>
1 parent c1fea19 commit 22bff94

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/format_check.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ jobs:
3737
libraries/examples/**
3838
libraries/extras/**
3939
libraries/ea_malloc/**
40-
write_output_files: true
41-
- name: List changed files
40+
json: true
41+
- name: Export changed files in a text file, one per line
4242
if: steps.changed-files.outputs.any_changed == 'true'
43-
run: cat .github/outputs/all_changed_files.txt
43+
run: |
44+
echo ${{ steps.changed-files.outputs.all_changed_files }} | jq -r '.[]' > all_changed_files.txt
45+
cat all_changed_files.txt
4446
- name: Run clang-format check
4547
if: steps.changed-files.outputs.any_changed == 'true'
4648
uses: pillo79/clang-format-action@05f671e71f0758aba4d3c9dbb0ee81bc5f0137c6
4749
with:
4850
clang-format-version: '19'
49-
check-files-from: .github/outputs/all_changed_files.txt
51+
check-files-from: all_changed_files.txt

0 commit comments

Comments
 (0)