Skip to content

Commit

Permalink
Add cleaning up for failures
Browse files Browse the repository at this point in the history
Signed-off-by: Guian Gumpac <[email protected]>
  • Loading branch information
GumpacG committed Aug 27, 2024
1 parent 8f61f0f commit 82eaf4e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/java-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 82eaf4e

Please sign in to comment.