From 119fc5812bc18fe86db72dcff07845821d376ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ch=C4=99ci=C5=84ski?= Date: Mon, 5 Sep 2022 11:39:22 +0200 Subject: [PATCH] Update deprecated Azure Key Vault in workflows (#2059) --- .github/workflows/build.yml | 45 ++++++++++++++++++++++-------- .github/workflows/crowdin-pull.yml | 15 +++++++--- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a47d79835..096b69d47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -441,10 +441,17 @@ jobs: - name: Retrieve secrets id: retrieve-secrets - uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f - with: - keyvault: "bitwarden-prod-kv" - secrets: "appcenter-ios-token" + env: + KEYVAULT: bitwarden-prod-kv + SECRETS: | + appcenter-ios-token + run: | + for i in ${SECRETS//,/ } + do + VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $i --query value --output tsv) + echo "::add-mask::$VALUE" + echo "::set-output name=$i::$VALUE" + done - name: Decrypt secrets env: @@ -635,10 +642,17 @@ jobs: - name: Retrieve secrets id: retrieve-secrets - uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f - with: - keyvault: "bitwarden-prod-kv" - secrets: "crowdin-api-token" + env: + KEYVAULT: bitwarden-prod-kv + SECRETS: | + crowdin-api-token + run: | + for i in ${SECRETS//,/ } + do + VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $i --query value --output tsv) + echo "::add-mask::$VALUE" + echo "::set-output name=$i::$VALUE" + done - name: Upload Sources uses: crowdin/github-action@9237b4cb361788dfce63feb2e2f15c09e2fe7415 @@ -695,11 +709,18 @@ jobs: - name: Retrieve secrets id: retrieve-secrets - uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f if: failure() - with: - keyvault: "bitwarden-prod-kv" - secrets: "devops-alerts-slack-webhook-url" + env: + KEYVAULT: bitwarden-prod-kv + SECRETS: | + devops-alerts-slack-webhook-url + run: | + for i in ${SECRETS//,/ } + do + VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $i --query value --output tsv) + echo "::add-mask::$VALUE" + echo "::set-output name=$i::$VALUE" + done - name: Notify Slack on failure uses: act10ns/slack@da3191ebe2e67f49b46880b4633f5591a96d1d33 diff --git a/.github/workflows/crowdin-pull.yml b/.github/workflows/crowdin-pull.yml index 90fb1f826..04d9374b5 100644 --- a/.github/workflows/crowdin-pull.yml +++ b/.github/workflows/crowdin-pull.yml @@ -24,10 +24,17 @@ jobs: - name: Retrieve secrets id: retrieve-secrets - uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403 - with: - keyvault: "bitwarden-prod-kv" - secrets: "crowdin-api-token" + env: + KEYVAULT: bitwarden-prod-kv + SECRETS: | + crowdin-api-token + run: | + for i in ${SECRETS//,/ } + do + VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $i --query value --output tsv) + echo "::add-mask::$VALUE" + echo "::set-output name=$i::$VALUE" + done - name: Download translations uses: crowdin/github-action@12143a68c213f3c6d9913c9e5023224f7231face