Skip to content

Commit

Permalink
Fix function commands
Browse files Browse the repository at this point in the history
  • Loading branch information
DanS01 committed Jun 19, 2022
1 parent c562716 commit d497fa0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions create-milestone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function create_milestone_curl_cmd()
DUE_ON=${2}

# Need to authenticate to obtain write access for the REST API POST event
CREATED_MILESTONE=$( curl --silent -X POST -H "Authorization: token ${SECRETS_TOKEN}" "Accept: application/vnd.github.v3+json" https://api.github.com/repos/"${REPOSITORY}"/milestones -d '{"title":"${TITLE}","due_on":"${DUE_ON}","state":"open"}' )
CREATED_MILESTONE=$( curl --silent -X POST -H "Authorization: token ${SECRETS_TOKEN}" "Accept: application/vnd.github.v3+json" https://api.github.com/repos/"${REPOSITORY}"/milestones -d '{"title":'\"${TITLE}\"',"due_on":'\"${DUE_ON}\"',"state":"open"}' )
}

function link_milestone_curl_cmd()
Expand All @@ -31,7 +31,7 @@ function link_milestone_curl_cmd()
ISSUE_NUMBER="${PULL_REQUEST_NUMBER}"

# Need to authenticate to obtain write access for the REST API PATCH event
LINKED_PULL_REQUEST=$( curl --silent -X PATCH -H "Authorization: token ${SECRETS_TOKEN}" "Accept: application/vnd.github.v3+json" https://api.github.com/repos/"${REPOSITORY}"/issues/"${ISSUE_NUMBER}" -d '{"milestone":"${MILESTONE_NUMBER}"}' )
LINKED_PULL_REQUEST=$( curl --silent -X PATCH -H "Authorization: token ${SECRETS_TOKEN}" "Accept: application/vnd.github.v3+json" https://api.github.com/repos/"${REPOSITORY}"/issues/"${ISSUE_NUMBER}" -d '{"milestone":'\"${MILESTONE_NUMBER}\"'}' )
}

# --------------------------------------------------------------------------------
Expand All @@ -56,7 +56,7 @@ echo Milestone Linked: "$MILESTONE_LINKED"
if [[ $MILESTONE_LINKED == "true" ]];
then
echo A milestone is already linked!
echo New milestone cannot be created and linked
echo New milestone cannot be created or linked
else
echo There is no milestone linked to the pull request

Expand Down

0 comments on commit d497fa0

Please sign in to comment.