From 58f11908050b78c0dd974500c49ca03198814892 Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 6 Jun 2023 21:02:33 +0100 Subject: [PATCH 1/4] Remove unused vars from workflows --- .../devcontainer_run_command/action.yml | 12 -------- .github/workflows/deploy_tre_reusable.yml | 30 ++----------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 864014e..15fea56 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -21,21 +21,12 @@ inputs: AAD_TENANT_ID: description: "The Tenant Id where the App is registered and the Test User is registered for the E2E Tests." required: false - TEST_APP_ID: - description: "The Test Application Id used to interact with the API." - required: false TEST_ACCOUNT_CLIENT_ID: description: "The Test Automation Account Client Id used to interact with the API." required: false TEST_ACCOUNT_CLIENT_SECRET: description: "The Test Automation Account Client Secret used to interact with the API." required: false - TEST_WORKSPACE_APP_ID: - description: "The Test Workspace application Id used to interact with the API." - required: false - TEST_WORKSPACE_APP_SECRET: - description: "The Test Workspace application secret used to interact with the API." - required: false TRE_ID: description: "The TRE Id." required: false @@ -211,9 +202,6 @@ runs: -e TRE_ID="${{ inputs.TRE_ID }}" \ -e TF_VAR_tre_id="${{ inputs.TRE_ID }}" \ -e TRE_URL="${{ env.TRE_URL }}" \ - -e TEST_WORKSPACE_APP_ID="${{ inputs.TEST_WORKSPACE_APP_ID }}" \ - -e TEST_WORKSPACE_APP_SECRET="${{ inputs.TEST_WORKSPACE_APP_SECRET }}" \ - -e TEST_APP_ID="${{ inputs.TEST_APP_ID }}" \ -e TEST_ACCOUNT_CLIENT_ID="${{ inputs.TEST_ACCOUNT_CLIENT_ID }}" \ -e TEST_ACCOUNT_CLIENT_SECRET="${{ inputs.TEST_ACCOUNT_CLIENT_SECRET }}" \ -e IS_API_SECURED=${{ inputs.IS_API_SECURED }} \ diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index ead35c1..3820de9 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -57,24 +57,12 @@ on: # yamllint disable-line rule:truthy MGMT_RESOURCE_GROUP_NAME: description: "" required: true - MS_TEAMS_WEBHOOK_URI: - description: "" - required: true MGMT_STORAGE_ACCOUNT_NAME: description: "" required: true SWAGGER_UI_CLIENT_ID: description: "" required: true - TEST_APP_ID: - description: "" - required: true - TEST_WORKSPACE_APP_ID: - description: "" - required: true - TEST_WORKSPACE_APP_SECRET: - description: "" - required: true TEST_ACCOUNT_CLIENT_ID: description: "" required: true @@ -141,15 +129,6 @@ jobs: if [ "${{ secrets.SWAGGER_UI_CLIENT_ID }}" == '' ]; then echo "Missing secret: SWAGGER_UI_CLIENT_ID" && exit 1 fi - if [ "${{ secrets.TEST_APP_ID }}" == '' ]; then - echo "Missing secret: TEST_APP_ID" && exit 1 - fi - if [ "${{ secrets.TEST_WORKSPACE_APP_ID }}" == '' ]; then - echo "Missing secret: TEST_WORKSPACE_APP_ID" && exit 1 - fi - if [ "${{ secrets.TEST_WORKSPACE_APP_SECRET }}" == '' ]; then - echo "Missing secret: TEST_WORKSPACE_APP_SECRET" && exit 1 - fi if [ "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" == '' ]; then echo "Missing secret: TEST_ACCOUNT_CLIENT_ID" && exit 1 fi @@ -240,10 +219,10 @@ jobs: run: | # shellcheck disable=SC2034,SC2015,SC2125 for i in {1..3}; do - az acr login --name "${{ secrets.CI_CACHE_ACR_NAME }}" && ec=0 && break || ec=\$? && sleep 10 + az acr login --name "${{ secrets.CI_CACHE_ACR_NAME }}" && ec=0 && break || ec=$? && sleep 10 done # shellcheck disable=SC2242 - (exit \$ec) + (exit $ec) - name: Push cached devcontainer run: docker image push ${{ env.CI_CACHE_ACR_URI }}/tredev:${{ inputs.DEVCONTAINER_TAG }} @@ -505,7 +484,6 @@ jobs: ACR_NAME: ${{ secrets.ACR_NAME }} API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}" AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}" - TEST_APP_ID: "${{ secrets.TEST_APP_ID }}" TEST_ACCOUNT_CLIENT_ID: "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" TEST_ACCOUNT_CLIENT_SECRET: "${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}" TRE_ID: ${{ secrets.TRE_ID }} @@ -563,7 +541,6 @@ jobs: ACR_NAME: ${{ secrets.ACR_NAME }} API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}" AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}" - TEST_APP_ID: "${{ secrets.TEST_APP_ID }}" TEST_ACCOUNT_CLIENT_ID: "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" TEST_ACCOUNT_CLIENT_SECRET: "${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}" TRE_ID: ${{ secrets.TRE_ID }} @@ -613,7 +590,6 @@ jobs: ACR_NAME: ${{ secrets.ACR_NAME }} API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}" AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}" - TEST_APP_ID: "${{ secrets.TEST_APP_ID }}" TEST_ACCOUNT_CLIENT_ID: "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" TEST_ACCOUNT_CLIENT_SECRET: "${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}" TRE_ID: ${{ secrets.TRE_ID }} @@ -645,7 +621,6 @@ jobs: AZURE_ENVIRONMENT: ${{ vars.AZURE_ENVIRONMENT }} API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}" AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}" - TEST_APP_ID: "${{ secrets.TEST_APP_ID }}" TEST_ACCOUNT_CLIENT_ID: "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" TEST_ACCOUNT_CLIENT_SECRET: "${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}" TRE_ID: ${{ secrets.TRE_ID }} @@ -661,7 +636,6 @@ jobs: AZURE_ENVIRONMENT: ${{ vars.AZURE_ENVIRONMENT }} API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}" AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}" - TEST_APP_ID: "${{ secrets.TEST_APP_ID }}" TEST_ACCOUNT_CLIENT_ID: "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" TEST_ACCOUNT_CLIENT_SECRET: "${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}" TRE_ID: ${{ secrets.TRE_ID }} From 887e97068e6d4ef169dea903b49c2799bb9697bc Mon Sep 17 00:00:00 2001 From: marrobi Date: Wed, 28 Jun 2023 09:19:56 +0000 Subject: [PATCH 2/4] Skip shellcheck for evaluating error code --- .github/workflows/deploy_tre_reusable.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index 3820de9..f445afe 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -219,6 +219,7 @@ jobs: run: | # shellcheck disable=SC2034,SC2015,SC2125 for i in {1..3}; do + # shellcheck disable=SC2086 az acr login --name "${{ secrets.CI_CACHE_ACR_NAME }}" && ec=0 && break || ec=$? && sleep 10 done # shellcheck disable=SC2242 From 5b62260b5058ac7237aeb6ac48f95c399a5ef5e6 Mon Sep 17 00:00:00 2001 From: marrobi Date: Wed, 28 Jun 2023 12:12:24 +0000 Subject: [PATCH 3/4] Add quotes to fix linting --- .github/workflows/deploy_tre_reusable.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index f445afe..3dfed68 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -219,8 +219,7 @@ jobs: run: | # shellcheck disable=SC2034,SC2015,SC2125 for i in {1..3}; do - # shellcheck disable=SC2086 - az acr login --name "${{ secrets.CI_CACHE_ACR_NAME }}" && ec=0 && break || ec=$? && sleep 10 + az acr login --name "${{ secrets.CI_CACHE_ACR_NAME }}" && ec=0 && break || ec="$?" && sleep 10 done # shellcheck disable=SC2242 (exit $ec) From d8a98bc26283441915b642b3e4663210223fe778 Mon Sep 17 00:00:00 2001 From: marrobi Date: Wed, 28 Jun 2023 12:24:20 +0000 Subject: [PATCH 4/4] Add quotes on exit ec --- .github/workflows/deploy_tre_reusable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index 3dfed68..8028b86 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -222,7 +222,7 @@ jobs: az acr login --name "${{ secrets.CI_CACHE_ACR_NAME }}" && ec=0 && break || ec="$?" && sleep 10 done # shellcheck disable=SC2242 - (exit $ec) + (exit "$ec") - name: Push cached devcontainer run: docker image push ${{ env.CI_CACHE_ACR_URI }}/tredev:${{ inputs.DEVCONTAINER_TAG }}