Skip to content

Commit

Permalink
Check only specific directories for git diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Starttoaster committed Dec 7, 2023
1 parent e88dc22 commit df5fec8
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ jobs:

- name: Check for git diffs
run: |
if git diff-index --quiet HEAD --; then
echo "No uncommitted changes."
exit 0
else
echo "Uncommitted changes found -- This may indicate that you made changes to the controller API but did not run \"make manifests\" before committing. Please see DEVELOPMENT.md"
git diff
exit 1
fi
diff=$(git diff-index HEAD --)
dirs=(api config hack internal)
for dir in "${dirs[@]}"; do
if [[ "$diff" != *"${dir}"* ]]; then
echo "No uncommitted changes in .${dir}/"
else
echo "Uncommitted changes found .${dir}/ -- This may indicate that you made changes to the controller API but did not run \"make manifests\" before committing. Please see DEVELOPMENT.md"
echo "${diff}"
exit 1
fi
done

0 comments on commit df5fec8

Please sign in to comment.