Use credentials when checking for milestones

This commit is contained in:
Phillip Webb 2023-01-19 14:04:38 -08:00
parent b70cb50d18
commit f7f2eb0bb4

View File

@ -43,7 +43,7 @@ if [[ $current = $latest ]]; then
exit 0;
fi
milestone_response=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones\?state\=open )
milestone_response=$( curl -s -u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones\?state\=open )
milestone_result=$( jq -r -c --arg MILESTONE "$MILESTONE" '.[] | select(has("title")) | select(.title==$MILESTONE)' <<< "$milestone_response" )
if [[ ${milestone_result} = "null" || ${milestone_result} = "" ]]; then
echo "Could not parse milestone: $milestone_response"