From 82eaf4e837711082b1ba1b9e30115319ed64149a Mon Sep 17 00:00:00 2001 From: Guian Gumpac Date: Tue, 27 Aug 2024 11:05:17 -0700 Subject: [PATCH] Add cleaning up for failures Signed-off-by: Guian Gumpac --- .github/workflows/java-cd.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/java-cd.yml b/.github/workflows/java-cd.yml index 42984cc27e..3c3123ca12 100644 --- a/.github/workflows/java-cd.yml +++ b/.github/workflows/java-cd.yml @@ -227,11 +227,13 @@ jobs: - name: Check status of deployment run: | - echo "BEARER_TOKEN=$(echo "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" | base64)" >> $GITHUB_ENV - echo "DEPLOYMENT_ID=6a48b2c5-c3c5-4941-bd38-6011b0985ae5" >> $GITHUB_ENV + export BEARER_TOKEN=$(echo "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" | base64) + export DEPLOYMENT_ID=6a48b2c5-c3c5-4941-bd38-6011b0985ae5 + echo "BEARER_TOKEN=$BEARER_TOKEN" | base64)" >> $GITHUB_ENV + echo "DEPLOYMENT_ID=$DEPLOYMENT_ID" >> $GITHUB_ENV export DEPLOYMENT_STATUS=`curl --request POST \ - --header "Authorization: Bearer ${{ env.BEARER_TOKEN }}" \ - "https://central.sonatype.com/api/v1/publisher/status?id=${{ env.DEPLOYMENT_ID }}" \ + --header "Authorization: Bearer $BEARER_TOKEN" \ + "https://central.sonatype.com/api/v1/publisher/status?id=$DEPLOYMENT_ID" \ | jq '.deploymentState'` if [[ $DEPLOYMENT_STATUS -ne ""VALIDATED"" || $DEPLOYMENT_STATUS -eq null ]]; then exit 1 ; fi