Skip to content

Commit

Permalink
ci: handle empty relevant commits array (#3770)
Browse files Browse the repository at this point in the history
  • Loading branch information
krtk6160 authored Jan 2, 2024
1 parent df6c9e9 commit bd2aa4e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions ci/apps/tasks/open-charts-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ ${github_url}/compare/${APP}-${old_ref}...${APP}-${ref}
Relevant commits:
EOF

for commit in "${relevant_commits[@]}"; do
cat <<EOF >> ../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 <<EOF >> ../body.md
Expand Down
14 changes: 9 additions & 5 deletions ci/tasks/open-charts-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ ${github_url}/compare/core-${old_ref}...core-${ref}
Relevant commits:
EOF

for commit in "${relevant_commits[@]}"; do
cat <<EOF >> ../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 <<EOF >> ../body.md
Expand Down

0 comments on commit bd2aa4e

Please sign in to comment.