Skip to content

Fix cppcheck skip logic on CI #3489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/run-ubuntu-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,19 @@ jobs:

steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0 # fetch full history

- name: Check if any src_c files changed
id: check-changes
continue-on-error: true
run: |
git fetch origin ${{ github.base_ref }} --depth=1 || true
git checkout ${{ github.base_ref }}
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
else
CHANGED_FILES=$(git diff --name-only HEAD^1...HEAD)
fi
echo "Changed files: $CHANGED_FILES"
echo "$CHANGED_FILES" | grep '^src_c/' || echo "skip=true" >> "$GITHUB_OUTPUT"

- name: Install cppcheck
Expand Down
Loading