diff --git a/ci/apps/tasks/open-charts-pr.sh b/ci/apps/tasks/open-charts-pr.sh index 4cd3bc4e27..4ff9ba2246 100755 --- a/ci/apps/tasks/open-charts-pr.sh +++ b/ci/apps/tasks/open-charts-pr.sh @@ -81,11 +81,15 @@ ${github_url}/compare/${APP}-${old_ref}...${APP}-${ref} Relevant commits: EOF -for commit in "${relevant_commits[@]}"; do - cat <> ../body.md -- ${github_url}/commit/${commit} -EOF -done +if [[ "${#relevant_commits[@]}" -eq 0 ]]; then + echo "- No relevant commits found" >> ../body.md +else + for commit in "${relevant_commits[@]}"; do + cat <<-EOF >> ../body.md + - ${github_url}/commit/${commit} + EOF + done +fi cat <> ../body.md diff --git a/ci/tasks/open-charts-pr.sh b/ci/tasks/open-charts-pr.sh index d334013713..90fda5dfe1 100755 --- a/ci/tasks/open-charts-pr.sh +++ b/ci/tasks/open-charts-pr.sh @@ -82,11 +82,15 @@ ${github_url}/compare/core-${old_ref}...core-${ref} Relevant commits: EOF -for commit in "${relevant_commits[@]}"; do - cat <> ../body.md -- ${github_url}/commit/${commit} -EOF -done +if [[ "${#relevant_commits[@]}" -eq 0 ]]; then + echo "- No relevant commits found" >> ../body.md +else + for commit in "${relevant_commits[@]}"; do + cat <<-EOF >> ../body.md + - ${github_url}/commit/${commit} + EOF + done +fi cat <> ../body.md