From 4d2beb22bd83fa187993a08919740fc6ca02b2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ch=C4=99ci=C5=84ski?= Date: Fri, 30 Sep 2022 16:24:43 +0200 Subject: [PATCH] Update deprecated Azure Key Vault in workflows (#68) * Update deprecated Azure Key Vault in workflows * Fix tests --- lint-workflow/tests/test.yml | 15 +++++++++++---- lint-workflow/tests/test_lint.py | 2 +- setup-docker-trust/action.yml | 21 ++++++++++++++------- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/lint-workflow/tests/test.yml b/lint-workflow/tests/test.yml index 49d4138a..56ff2192 100644 --- a/lint-workflow/tests/test.yml +++ b/lint-workflow/tests/test.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@e39093fd75daae7859c68eded4b43d42ec78d8ea # v1.3.2 diff --git a/lint-workflow/tests/test_lint.py b/lint-workflow/tests/test_lint.py index 1c951505..5b763490 100644 --- a/lint-workflow/tests/test_lint.py +++ b/lint-workflow/tests/test_lint.py @@ -10,7 +10,7 @@ def test_lint(capfd): in out ) assert ( - "\x1b[33mwarning\x1b[0m Step 3 of job key 'crowdin-pull' uses an outdated action, consider updating it" + "\x1b[33mwarning\x1b[0m Step 4 of job key 'crowdin-pull' uses an outdated action, consider updating it" in out ) assert ( diff --git a/setup-docker-trust/action.yml b/setup-docker-trust/action.yml index b0d0f2d9..c1ed22a0 100644 --- a/setup-docker-trust/action.yml +++ b/setup-docker-trust/action.yml @@ -27,13 +27,20 @@ runs: - name: Retrieve secrets id: get-secrets - uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403 - with: - keyvault: ${{ inputs.azure-keyvault-name }} - secrets: "docker-password, - docker-username, - dct-delegate-repo-passphrase, - dct-delegate-key" + env: + KEYVAULT: ${{ inputs.azure-keyvault-name }} + SECRETS: | + docker-password, + docker-username, + dct-delegate-repo-passphrase, + dct-delegate-key + 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: Log into Docker shell: bash