Skip to content

Commit 49bd813

Browse files
committed
feat: Add clang-format on new files
Signed-off-by: gsstoykov <[email protected]>
1 parent 35cc119 commit 49bd813

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/zxc-build-library.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,20 @@ jobs:
100100
with:
101101
submodules: true
102102

103-
- name: Run Clang-Format
103+
- name: Get modified files
104+
id: modified-files
105+
run: |
106+
# Get the list of changed files in this PR
107+
files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} -- '*.cc' '*.h')
108+
echo "Modified files: $files"
109+
echo "modified_files=$files" >> $GITHUB_ENV
110+
111+
- name: Run Clang-Format on Modified Files
112+
if: env.modified_files != ''
104113
uses: jidicula/clang-format-action@c74383674bf5f7c69f60ce562019c1c94bc1421a # v4.13.0
105-
with:
106-
clang-format-version: "17"
107-
check-path: "src"
114+
with:
115+
clang-format-version: "17"
116+
check-path: ${{ env.modified_files }} # Only run clang-format on modified files
108117

109118
- name: Use Node.js 22
110119
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0

0 commit comments

Comments
 (0)