fixed deploy (#1269)

* fixed deploy

* fixed pr name

* fixed spacing
This commit is contained in:
Lukas Gravley 2021-02-26 09:44:32 -06:00 committed by GitHub
parent 7ea2fd764e
commit 0031981b46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 9 deletions

View file

@ -127,7 +127,7 @@ CommitAndPush() {
# Push the code to the branch and create PR
PUSH_CMD=$(
git push --set-upstream origin "Automation-Release-${VERSION}"
gh pr create --title "Update-to-release-${VERSION}" --body "Automation Upgrade version ${VERSION} to action.yml" 2>&1
gh pr create --title "Release-update-to-${VERSION}" --body "Automation Upgrade version ${VERSION} to action.yml" 2>&1
)
# Load the error code
@ -186,12 +186,14 @@ UpdatePRBody() {
echo "Updating PR body with Release information and Issue linkage..."
# Need to update the body of the PR with the information
UPDATE_PR_CMD=$(curl -s --fail -X PATCH \
UPDATE_PR_CMD=$(
curl -s --fail -X PATCH \
--url "${GITHUB_API}/repos/${ORG}/${REPO}/pulls/${PR_ID}" \
-H 'Accept: application/vnd.github.shadow-cat-preview+json,application/vnd.github.sailor-v-preview+json' \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H 'Content-Type: application/json' \
--data "{\"body\": \"Automation Creation of Super-Linter\n\nThis closes #${ISSUE_NUMBER}\n\n${UPDATED_BODY_STRING}\"}" 2>&1)
--data "{\"body\": \"Automation Creation of Super-Linter\n\nThis closes #${ISSUE_NUMBER}\n\n${UPDATED_BODY_STRING}\"}" 2>&1
)
# Load the error code
ERROR_CODE=$?
@ -205,6 +207,29 @@ UpdatePRBody() {
else
echo "Successfully updated PR body"
fi
# Add the label for the release
UPDATE_LABEL_CMD=$(
curl -s --fail -X POST \
--url "${GITHUB_API}/repos/${ORG}/${REPO}/issues/${PR_ID}/labels" \
-H 'Accept: application/vnd.github.v3+json' \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H 'Content-Type: application/json' \
--data '{"labels":["Release"]}' 2>&1
)
# Load the error code
ERROR_CODE=$?
# Check the shell for errors
if [ "${ERROR_CODE}" -ne 0 ]; then
# ERROR
echo "ERROR! Failed to update PR label!"
echo "ERROR:[$UPDATE_LABEL_CMD]"
exit 1
else
echo "Successfully updated PR label"
fi
}
################################################################################
#### Function UpdateReleaseBodyString ##########################################

View file

@ -66,7 +66,7 @@ jobs:
# Update deployment API #
#########################
- name: Start deployment
uses: bobheadxi/deployments@v0.5.1
uses: bobheadxi/deployments@v0.4.3
id: deployment
with:
step: start
@ -173,7 +173,7 @@ jobs:
# Update Deployment API #
#########################
- name: Update deployment status
uses: bobheadxi/deployments@v0.5.1
uses: bobheadxi/deployments@v0.4.3
if: always()
with:
step: finish