Commit 8549eb99 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Resolve issue when double quotes are part of the description

parent 944ea98e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -67,20 +67,21 @@ if [ ${3} == "all" ] ; then
else
  merge_requests=$(curl "${1}/projects/${2}/merge_requests?state=opened&milestone=${3}&target_branch=${4}")
fi
echo "${merge_requests}" | jq -c '.[]' | while read mr; do
  mr_id=$(echo "$mr" | jq '.iid')

printf '%s' "${merge_requests}" | jq -c '.[]' | while read -r mr; do
  mr_id=$(printf '%s' "$mr" | jq -r '.iid')
  result_id=$?
  if [ ! $result_id == 0 ] ; then
    echo "ERROR: When retrieving merge request id"
    continue
  fi
  mr_title=$(echo "$mr" | jq '.title')
  mr_title=$(printf '%s' "$mr" | jq -r '.title')
  result_title=$?
  if [ ! $result_title == 0 ] ; then
    echo "ERROR: When retrieving merge request title"
    continue
  fi
  mr_source_branch=$(echo "$mr" | jq -r '.source_branch')
  mr_source_branch=$(printf '%s' "$mr" | jq -r '.source_branch')
  result_source_branch=$?
  if [ ! $result_source_branch == 0 ] ; then
    echo "ERROR: When retrieving merge request source branch"