Skip to content

Commit

Permalink
Added echo if no manifests bumped ↞ [auto-sync from https://github.co…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Dec 9, 2024
1 parent bcfc7fc commit cea4ce0
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions utils/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,21 @@ for manifest in "${MANIFEST_PATHS[@]}" ; do
echo -e "$bumped_msg" ; ((bumped_cnt++))
done

# Define COMMIT MSG
COMMIT_MSG="Bumped \`version\`"
unique_versions=($(printf "%s\n" "${new_versions[@]}" | sort -u))
if [[ ${#unique_versions[@]} -eq 1 ]] ; then
COMMIT_MSG+=" to \`${unique_versions[0]}\`" ; fi

# COMMIT/PUSH bump(s)
echo -e "${BY}\nCommitting $((( $bumped_cnt > 1 )) && echo bumps || echo bump) to Git...\n${NC}"
git add ./**/manifest.json && git commit -n -m "$COMMIT_MSG"
git push
if [[ $bumped_cnt -eq 0 ]] ; then echo -e "${BW}Completed. No manifests bumped.${NC}"
else
echo -e "\n${BY}Committing $( (( bumped_cnt > 1 )) && echo bumps || echo bump) to Git...${NC}"

# Define commit msg
COMMIT_MSG="Bumped \`version\`"
unique_versions=($(printf "%s\n" "${new_versions[@]}" | sort -u))
if [[ ${#unique_versions[@]} -eq 1 ]] ; then COMMIT_MSG+=" to \`${unique_versions[0]}\`" ; fi

# Commit/push bump(s)
git add ./**/manifest.json && git commit -n -m "$COMMIT_MSG"
git push

# Print FINAL summary
manifest_label=$((( $bumped_cnt > 1 )) && echo "${bumped_cnt} manifests" || echo "${MANIFEST_PATHS[0]}")
echo -e "\n${BG}Success! ${manifest_label} updated/committed/pushed to GitHub${NC}"
# Print final summary
manifest_label=$( [[ $bumped_cnt -gt 1 ]] && echo "manifests" || echo "manifest")
echo -e "\n${BG}Success! ${bumped_cnt} ${manifest_label} updated/committed/pushed to GitHub${NC}"
fi

0 comments on commit cea4ce0

Please sign in to comment.