From 9335f68409f5616606e0dde7dc05205999cd7d0b Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Tue, 24 May 2022 14:59:31 -0400 Subject: [PATCH] fix(ci): set a network env variable to be used in `get-available-disks` (#4477) * fix(ci): set a network env variable to be used in `get-available-disks` * docs(ci): improve comment --- .github/workflows/continous-integration-docker.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/continous-integration-docker.yml b/.github/workflows/continous-integration-docker.yml index c834b137..32c84467 100644 --- a/.github/workflows/continous-integration-docker.yml +++ b/.github/workflows/continous-integration-docker.yml @@ -64,6 +64,8 @@ env: # TODO: use the output from ./.github/workflows/build-docker-image.yml IMAGE_NAME: zebrad-test GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra + # TODO: use environmental secrets for dynamic values + NETWORK: Mainnet jobs: get-available-disks: @@ -91,6 +93,15 @@ jobs: service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' + # Disk images in GCP are required to be in lowercase, but the blockchain network + # uses sentence case, so we need to downcase ${{ env.NETWORK or github.event.inputs.network }} + # + # Passes a lowercase Network name to subsequent steps using $NETWORK env variable + - name: Downcase network name for disks + run: | + NETWORK_CAPS=${{ env.NETWORK || github.event.inputs.network }} + echo "NETWORK=${NETWORK_CAPS,,}" >> $GITHUB_ENV + # Find a cached state disk for subsequent jobs needing a cached state without # restricting the result from any branch. #