From 551f4a91719bb59d69621abf6e3ded29bdf98689 Mon Sep 17 00:00:00 2001 From: Andrea Grillo Date: Mon, 8 Apr 2024 12:57:43 +0200 Subject: [PATCH] fix syntax --- .github/workflows/call_code_review.yaml | 14 ++++++-------- .github/workflows/call_release.yaml | 16 +++++++--------- .github/workflows/elt_cd.yaml | 2 +- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/call_code_review.yaml b/.github/workflows/call_code_review.yaml index 40ee1407d..118af2e49 100644 --- a/.github/workflows/call_code_review.yaml +++ b/.github/workflows/call_code_review.yaml @@ -11,14 +11,11 @@ on: type: string required: false description: List of environment variables to set up, given in env=value format. - job_agent: - type: choice - options: - - ubuntu-20.04 - - self-hosted - default: ubuntu-20-04 + use_self_hosted_agent: + type: boolean + default: false required: false - description: Specify which agent must be used, managed or self hosted + description: True to use a vnet integrated self-hosted agent env: ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} @@ -26,11 +23,12 @@ env: ARM_USE_OIDC: true ARM_USE_AZUREAD: true ARM_STORAGE_USE_AZUREAD: true + AGENT: ${{ inputs.use_self_hosted_agent == true && 'ubuntu-20.04' || 'self-hosted' }} jobs: tf_plan: name: 'Terraform Plan' - runs-on: ${{ inputs.job_agent }} + runs-on: ${{ env.AGENT }} environment: ${{ inputs.environment }}-ci permissions: id-token: write diff --git a/.github/workflows/call_release.yaml b/.github/workflows/call_release.yaml index bc6fe69a1..23a2b046a 100644 --- a/.github/workflows/call_release.yaml +++ b/.github/workflows/call_release.yaml @@ -11,14 +11,11 @@ on: type: string required: false description: List of environment variables to set up, given in env=value format. - job_agent: - type: choice - options: - - ubuntu-20.04 - - self-hosted - default: ubuntu-20-04 + use_self_hosted_agent: + type: boolean + default: false required: false - description: Specify which agent must be used, managed or self hosted + description: True to use a vnet integrated self-hosted agent env: ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} @@ -26,12 +23,13 @@ env: ARM_USE_OIDC: true ARM_USE_AZUREAD: true ARM_STORAGE_USE_AZUREAD: true + AGENT: ${{ inputs.use_self_hosted_agent == true && 'ubuntu-20.04' || 'self-hosted' }} jobs: tf_plan: name: 'Terraform Plan' - runs-on: ${{ inputs.job_agent }} + runs-on: ${{ env.AGENT }} environment: ${{ inputs.environment }}-ci permissions: id-token: write @@ -94,7 +92,7 @@ jobs: tf_apply: name: 'Terraform Apply' - runs-on: ${{ inputs.job_agent }} + runs-on: ${{ env.AGENT }} needs: [tf_plan] environment: ${{ inputs.environment }}-cd permissions: diff --git a/.github/workflows/elt_cd.yaml b/.github/workflows/elt_cd.yaml index fd1c81fb3..68ce05b1c 100644 --- a/.github/workflows/elt_cd.yaml +++ b/.github/workflows/elt_cd.yaml @@ -16,4 +16,4 @@ jobs: with: environment: prod dir: "src/domains/elt/prod/westeurope" - job_agent: self-hosted + use_self_hosted_agent: true