From 33257a9d7c400cef3ba7f0ee0b9b27ea30c31aae Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 9 Jan 2025 18:16:05 +0100 Subject: [PATCH] ci/request-reviews: Fix code owner requests for filenames with spaces Discovered in https://github.com/NixOS/nixpkgs/pull/368656#issuecomment-2564266513 --- ci/request-reviews/get-code-owners.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/request-reviews/get-code-owners.sh b/ci/request-reviews/get-code-owners.sh index f447e2a7e597e..13a377429b923 100755 --- a/ci/request-reviews/get-code-owners.sh +++ b/ci/request-reviews/get-code-owners.sh @@ -36,7 +36,8 @@ declare -A users=() for file in "${touchedFiles[@]}"; do result=$(codeowners --file "$tmp"/codeowners "$file") - read -r file owners <<< "$result" + # Remove the file prefix and trim the surrounding spaces + read -r owners <<< "${result#"$file"}" if [[ "$owners" == "(unowned)" ]]; then log "File $file is unowned" continue