Polish "Automate Docker update in CI"

See gh-20530
This commit is contained in:
Madhura Bhave
2020-03-30 17:26:09 -07:00
parent 4752d7e91a
commit e174231d15
5 changed files with 22 additions and 22 deletions

View File

@@ -1,11 +1,17 @@
#!/bin/bash
set -e
curl \
-s \
-u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} \
-H "Content-type:application/json" \
-d "{\"head\":\"${BRANCH}\",\"base\":\"${BASE_BRANCH}\",\"title\":\"${ISSUE_TITLE}\",\"body\":\"\",\"labels\":[\"status: waiting-for-triage\",\"type: task\"]}" \
-f \
-X \
POST "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/pulls" > /dev/null || { echo "Failed to create pull request" >&2; exit 1; }
commit_message=$( cat commit-details/message )
if [[ ${commit_message} != "" ]]; then
curl \
-s \
-u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} \
-H "Content-type:application/json" \
-d "{\"head\":\"${BRANCH}\",\"base\":\"${BASE_BRANCH}\",\"title\":\"${ISSUE_TITLE}\",\"body\":\"\",\"labels\":[\"status: waiting-for-triage\",\"type: task\"]}" \
-f \
-X \
POST "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/pulls" > /dev/null || { echo "Failed to create pull request" >&2; exit 1; }
else
echo "Already up-to-date"
fi