diff --git a/.github/workflows/cleanup-after-pr.yml b/.github/workflows/cleanup-after-pr.yml index c61d509b1..b63dd4a30 100644 --- a/.github/workflows/cleanup-after-pr.yml +++ b/.github/workflows/cleanup-after-pr.yml @@ -10,9 +10,6 @@ jobs: name: Remove branch-specific Docker images runs-on: ubuntu-22.04 steps: - - name: Check out repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - ########## ACR ########## - name: Log in to Azure - QA Subscription uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 @@ -33,6 +30,7 @@ jobs: ########## Remove Docker images ########## - name: Remove the Docker image from ACR env: + REF: ${{ github.event.pull_request.head.ref }} REGISTRIES: | registries: - bitwardenprod @@ -59,7 +57,7 @@ jobs: for REGISTRY in $( echo "${{ env.REGISTRIES }}" | yq e ".registries[]" - ) do SERVICE_NAME=$(echo $SERVICE | awk '{print tolower($0)}') - IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g") # slash safe branch name + IMAGE_TAG=$(echo "${REF}" | sed "s#/#-#g") # slash safe branch name echo "[*] Checking if remote exists: $REGISTRY.azurecr.io/$SERVICE_NAME:$IMAGE_TAG" TAG_EXISTS=$(