@ -11,7 +11,8 @@ if [[ $current = $latest ]]; then
exit 0;
fi
existing_tasks = $( curl -s https://api.github.com/repos/${ GITHUB_ORGANIZATION } /${ GITHUB_REPO } /issues\? labels\= type:%20task\& state\= open\& creator\= spring-buildmaster )
milestone_number = $( curl -s https://api.github.com/repos/${ GITHUB_ORGANIZATION } /${ GITHUB_REPO } /milestones\? state\= open | jq -c --arg MILESTONE " $MILESTONE " '.[] | select(.title==$MILESTONE)' | jq -r '.number' )
existing_tasks = $( curl -s https://api.github.com/repos/${ GITHUB_ORGANIZATION } /${ GITHUB_REPO } /issues\? labels\= type:%20task\& state\= open\& creator\= spring-buildmaster\& milestone\= ${ milestone_number } )
existing_upgrade_issues = $( echo " $existing_tasks " | jq -c --arg TITLE " $ISSUE_TITLE " '.[] | select(.title==$TITLE)' )
if [ [ ${ existing_upgrade_issues } = "" ] ] ; then
@ -19,7 +20,7 @@ if [[ ${existing_upgrade_issues} = "" ]]; then
-s \
-u ${ GITHUB_USERNAME } :${ GITHUB_PASSWORD } \
-H "Content-type:application/json" \
-d " {\"title\":\" ${ ISSUE_TITLE } \",\" body\": \"Upgrade to ubuntu:${ ubuntu } - ${ latest } \",\"labels\":[\"status: waiting-for-triage\",\"type: task\"]} " \
-d " {\"title\":\" ${ ISSUE_TITLE } \",\" milestone\":\"${ milestone_number } \",\" body\": \"Upgrade to ubuntu:${ ubuntu } - ${ latest } \",\"labels\":[\"status: waiting-for-triage\",\"type: task\"]} " \
-f \
-X \
POST " https://api.github.com/repos/ ${ GITHUB_ORGANIZATION } / ${ GITHUB_REPO } /issues " > /dev/null || { echo "Failed to create issue" >& 2; exit 1; }