Skip to content

Commit afa2258

Browse files
committed
fix(scripts): check if PR list is empty.
1 parent 4cc270b commit afa2258

File tree

3 files changed

+26196
-1572
lines changed

3 files changed

+26196
-1572
lines changed

scripts/release/check_commit_metadata.sh

+13-9
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,20 @@ main() {
8282
--json mergeCommit,labels,author \
8383
--jq '.[] | "\( .mergeCommit.oid ) author:\( .author.login ) labels:\(["label:\( .labels[].name )"] | join(" "))"'
8484
)"
85-
mapfile -t pr_metadata_raw <<<"$pr_list_out"
85+
8686
declare -A authors labels
87-
for entry in "${pr_metadata_raw[@]}"; do
88-
commit_sha_long=${entry%% *}
89-
commit_author=${entry#* author:}
90-
commit_author=${commit_author%% *}
91-
authors[$commit_sha_long]=$commit_author
92-
all_labels=${entry#* labels:}
93-
labels[$commit_sha_long]=$all_labels
94-
done
87+
if [ -n "$pr_list_out" ]; then
88+
mapfile -t pr_metadata_raw <<<"$pr_list_out"
89+
90+
for entry in "${pr_metadata_raw[@]}"; do
91+
commit_sha_long=${entry%% *}
92+
commit_author=${entry#* author:}
93+
commit_author=${commit_author%% *}
94+
authors[$commit_sha_long]=$commit_author
95+
all_labels=${entry#* labels:}
96+
labels[$commit_sha_long]=$all_labels
97+
done
98+
fi
9599

96100
for commit in "${commits[@]}"; do
97101
mapfile -d ' ' -t parts <<<"$commit"

0 commit comments

Comments
 (0)