mirror of https://github.com/coder/coder.git
fix(scripts): check if PR list is empty (#8805)
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
This commit is contained in:
parent
612f1c6a55
commit
53f26b313d
|
@ -82,16 +82,20 @@ main() {
|
||||||
--json mergeCommit,labels,author \
|
--json mergeCommit,labels,author \
|
||||||
--jq '.[] | "\( .mergeCommit.oid ) author:\( .author.login ) labels:\(["label:\( .labels[].name )"] | join(" "))"'
|
--jq '.[] | "\( .mergeCommit.oid ) author:\( .author.login ) labels:\(["label:\( .labels[].name )"] | join(" "))"'
|
||||||
)"
|
)"
|
||||||
mapfile -t pr_metadata_raw <<<"$pr_list_out"
|
|
||||||
declare -A authors labels
|
declare -A authors labels
|
||||||
for entry in "${pr_metadata_raw[@]}"; do
|
if [[ -n $pr_list_out ]]; then
|
||||||
commit_sha_long=${entry%% *}
|
mapfile -t pr_metadata_raw <<<"$pr_list_out"
|
||||||
commit_author=${entry#* author:}
|
|
||||||
commit_author=${commit_author%% *}
|
for entry in "${pr_metadata_raw[@]}"; do
|
||||||
authors[$commit_sha_long]=$commit_author
|
commit_sha_long=${entry%% *}
|
||||||
all_labels=${entry#* labels:}
|
commit_author=${entry#* author:}
|
||||||
labels[$commit_sha_long]=$all_labels
|
commit_author=${commit_author%% *}
|
||||||
done
|
authors[$commit_sha_long]=$commit_author
|
||||||
|
all_labels=${entry#* labels:}
|
||||||
|
labels[$commit_sha_long]=$all_labels
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
for commit in "${commits[@]}"; do
|
for commit in "${commits[@]}"; do
|
||||||
mapfile -d ' ' -t parts <<<"$commit"
|
mapfile -d ' ' -t parts <<<"$commit"
|
||||||
|
|
Loading…
Reference in New Issue