File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments