diff --git a/.automation/update-actions-version.sh b/.automation/update-actions-version.sh index 53065ebf..f5017879 100755 --- a/.automation/update-actions-version.sh +++ b/.automation/update-actions-version.sh @@ -22,6 +22,7 @@ VERSION='' # Version of release pulled from api ACTION_FILE='action.yml' # Action file to update PR_ID='' # PUll Request ID when created UPDATED_BODY_STRING='' # Issue body string converted +COMMIT_SHA='' # COmmit sha when PR is created ############## # Built Vars # @@ -152,6 +153,22 @@ CommitAndPush() { fi done + # get the current commit sha + COMMIT_SHA=$(git rev-parse --short HEAD 2>&1) + + # Load the error code + ERROR_CODE=$? + + # Check the shell for errors + if [ "${ERROR_CODE}" -ne 0 ]; then + # ERROR + echo "ERROR! Failed to get comit sha!" + echo "ERROR:[$COMMIT_SHA]" + exit 1 + else + echo "Successfully grabbed commit sha" + fi + } ################################################################################ #### Function UpdateBaseIssue ################################################## @@ -256,6 +273,9 @@ SetActionsVariables() { echo "Setting PR_REF:[Automation-Release-${VERSION}]" echo "PR_REF=Automation-Release-${VERSION}" >>"${GITHUB_ENV}" + + echo "Setting COMMIT_SHA:[${COMMIT_SHA}]" + echo "COMMIT_SHA=${COMMIT_SHA}" >>"${GITHUB_ENV}" } ################################################################################ #### Function Footer ########################################################### diff --git a/.github/workflows/deploy-RELEASE.yml b/.github/workflows/deploy-RELEASE.yml index b64ef8f1..f8a53939 100644 --- a/.github/workflows/deploy-RELEASE.yml +++ b/.github/workflows/deploy-RELEASE.yml @@ -110,7 +110,7 @@ jobs: - name: Update actions.yml with release version and create PR if: success() run: ./.automation/update-actions-version.sh - # Note: script creates variables: PR_ID PR_REF RELEASE_VERSION + # Note: script creates variables: PR_ID PR_REF RELEASE_VERSION COMMIT_SHA env: DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -158,6 +158,17 @@ jobs: draft: false prerelease: false + ##################################################### + # Create the Required status check for Stack Linter # + ##################################################### + - name: Create Stack Linter Status + if: success() + run: | + curl -X POST --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.COMMIT_SHA }} \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + --data '{ "state": "success", "context": "Stack linter" }' + ################################# # Close the opened Pull Request # ################################# @@ -180,4 +191,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} status: ${{ job.status }} deployment_id: ${{ steps.deployment.outputs.deployment_id }} - env_url: https://github.com/orgs/${{github.repository_owner}}/packages?repo_name=${{github.repository.name}} + env_url: https://github.com/orgs/${{github.repository_owner}}/container/package/${{github.repository.name}}