From 0031981b465666f0ad5ef57d50c97ca53c54a687 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Fri, 26 Feb 2021 09:44:32 -0600 Subject: [PATCH] fixed deploy (#1269) * fixed deploy * fixed pr name * fixed spacing --- .automation/update-actions-version.sh | 39 ++++++++++++++++++++++----- .github/workflows/deploy-RELEASE.yml | 4 +-- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/.automation/update-actions-version.sh b/.automation/update-actions-version.sh index 561d04a6..53065ebf 100755 --- a/.automation/update-actions-version.sh +++ b/.automation/update-actions-version.sh @@ -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 \ - --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) + 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 + ) # 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 ########################################## diff --git a/.github/workflows/deploy-RELEASE.yml b/.github/workflows/deploy-RELEASE.yml index d47e4469..b64ef8f1 100644 --- a/.github/workflows/deploy-RELEASE.yml +++ b/.github/workflows/deploy-RELEASE.yml @@ -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