File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -138,10 +138,18 @@ jobs:
138138
139139 - name : Check if any src_c files changed
140140 id : check-changes
141+ continue-on-error : true
141142 run : |
142- git fetch origin ${{ github.base_ref }} --depth=1 || true
143- git checkout ${{ github.base_ref }}
144- CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
143+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
144+ git fetch origin ${{ github.base_ref }} --depth=1
145+ git checkout ${{ github.base_ref }}
146+ CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
147+ else
148+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
149+ git fetch origin "$CURRENT_BRANCH" --depth=2
150+ CHANGED_FILES=$(git diff --name-only HEAD^1...HEAD)
151+ fi
152+ echo "Changed files: $CHANGED_FILES"
145153 echo "$CHANGED_FILES" | grep '^src_c/' || echo "skip=true" >> "$GITHUB_OUTPUT"
146154
147155 - name : Install cppcheck
You can’t perform that action at this time.
0 commit comments