Skip to content

Commit

Permalink
Account for deleted files in workflow files
Browse files Browse the repository at this point in the history
Do not try to perform checks on files that have been removed
  • Loading branch information
rafaelroquetto committed Oct 2, 2024
1 parent c6c0aa1 commit 7219b6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Check Clang Format
run: |
# Check for modified C/C++ files
files=$(git diff --name-only origin/main...HEAD | grep -E '\.(c|cpp|h)$' || true)
files=$(git diff --name-status origin/main...HEAD | awk '$1 != "D" && /\.(c|cpp|h)$/ { print $2 }' || true)
if [ -z "$files" ]; then
echo "No C/C++ files modified."
exit 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/git-lfs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Check git-lfs files
run: |
files=$(git diff --name-only origin/main...HEAD | grep '\.o$' || true)
files=$(git diff --name-status origin/main...HEAD | awk '$1 != "D" && /\.o$/ { print $2 }' || true)
if [ -z "$files" ]; then
echo "No .o files modified"
exit 0
Expand Down

0 comments on commit 7219b6c

Please sign in to comment.