Skip to content

Commit

Permalink
chore: fix for wide open ssh for vsi for Z (quay#3591)
Browse files Browse the repository at this point in the history
fix for wide open ssh for vsi
  • Loading branch information
sivaramsingana authored Feb 7, 2025
1 parent 55d2bf8 commit 65f08a5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ jobs:
BRANCH_NAME=${GITHUB_REF#refs/heads/}
echo "version=${BRANCH_NAME/${{ env.BRANCH_PREFIX }}/}" >> $GITHUB_OUTPUT
- name: install ibmcli and setup ibm login
run: |
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
ibmcloud login -q --apikey ${{ secrets.IBMCLOUD_API_KEY }} -r eu-gb
ibmcloud plugin install vpc-infrastructure
- name: Add rule to VPC
id: sg-rule-id
run: |
cidr="$(hostname -i)"
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
echo "RID=${SGRID}" >> $GITHUB_ENV
- name: Setup SSH config for builders
env:
BUILDER_AARCH64_SSH_CONFIG: ${{ secrets.BUILDER_AARCH64_SSH_CONFIG }}
Expand Down Expand Up @@ -110,3 +125,7 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}:${{ github.event.inputs.tag || env.TAG }}

- name: Clean up
run: |
ibmcloud is security-group-rule-delete ${{ secrets.SG_ID }} $RID -f

0 comments on commit 65f08a5

Please sign in to comment.