From 2141e96448e430f6e5162f81c90a94e6b6491af2 Mon Sep 17 00:00:00 2001 From: Sivaram Singana <47631665+sivaramsingana@users.noreply.github.com> Date: Tue, 4 Mar 2025 19:35:57 +0530 Subject: [PATCH] chore: Change in the CIDR for Z (#3693) --- .github/workflows/build-and-publish.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index b628844e9..c5b5a64d8 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -40,7 +40,7 @@ jobs: - name: Add rule to VPC id: sg-rule-id run: | - cidr="$(hostname -i)" + cidr=$(dig +short myip.opendns.com @resolver1.opendns.com) echo $cidr SGRID=$(ibmcloud is security-group-rule-add --sg ${{ secrets.SG_ID }} --direction=inbound --protocol=tcp --port-min=22 --port-max=22 --remote=$cidr --output JSON | jq -r '.id') echo $SGRID @@ -127,5 +127,6 @@ jobs: tags: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}:${{ github.event.inputs.tag || env.TAG }} - name: Clean up + if: success() || failure() run: | ibmcloud is security-group-rule-delete ${{ secrets.SG_ID }} $RID -f