Skip to content

Commit

Permalink
check codeowners update to catch more than one new file (#16322)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmtolmach authored Apr 15, 2024
1 parent fe76f3b commit cce240d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/scripts/check_codeowners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ HEAD_SHA=$(git rev-parse HEAD)
BASE_SHA=$(git rev-parse origin/master)

# Get the list of changed files between the base and head commits
IFS=$'\n' # Change IFS to split only on newlines
CHANGED_FILES=$(git diff --name-only --diff-filter=AMR ${BASE_SHA}...${HEAD_SHA})
echo "Changed files: $CHANGED_FILES"

Expand All @@ -37,7 +38,7 @@ check_in_codeowners() {
return 1
}

for FILE in "${CHANGED_FILES}"; do
for FILE in ${CHANGED_FILES}; do
# Ignore files starting with a dot
if [[ $FILE == .* ]]; then
echo "Ignoring file $FILE"
Expand All @@ -53,3 +54,4 @@ for FILE in "${CHANGED_FILES}"; do
done

echo "All changed files or their parent directories have a CODEOWNERS entry."
IFS=$' \t\n' # Reset IFS after the loop

0 comments on commit cce240d

Please sign in to comment.