From ac5ec97cb4f13e0eafe4c00bf392f0d6cf52054a Mon Sep 17 00:00:00 2001 From: shenlan Date: Tue, 30 Sep 2025 00:35:10 +0800 Subject: [PATCH] Fix deploy action condition expressions --- ...c-pipeline-vultr-landingzone-baseline.yaml | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/iac-pipeline-vultr-landingzone-baseline.yaml b/.github/workflows/iac-pipeline-vultr-landingzone-baseline.yaml index d59b143c..0228d4d4 100644 --- a/.github/workflows/iac-pipeline-vultr-landingzone-baseline.yaml +++ b/.github/workflows/iac-pipeline-vultr-landingzone-baseline.yaml @@ -53,17 +53,17 @@ on: PULUMI_ACCESS_TOKEN: required: true -env: - PULUMI_CI: 'true' - CONFIG_PATH: ${{ inputs.config_path || github.event.inputs.config_path || 'config/vultr' }} - DEPLOY_ACTION: ${{ inputs.deploy_action || github.event.inputs.deploy_action || 'upgrade' }} - DEPLOY_DRY_RUN: ${{ inputs.deploy_dry_run || github.event.inputs.deploy_dry_run || 'true' }} - jobs: init: name: Initialize Vultr Pulumi stacks runs-on: ubuntu-latest - if: ${{ env.DEPLOY_ACTION == 'init' }} + env: + PULUMI_CI: 'true' + if: >- + ${{ + (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_action == 'init') || + (github.event_name == 'workflow_call' && inputs.deploy_action == 'init') + }} steps: - uses: actions/checkout@v4 - uses: pulumi/setup-pulumi@v3 @@ -80,8 +80,15 @@ jobs: preview: name: Preview baseline changes - if: ${{ env.DEPLOY_ACTION != 'init' }} + if: >- + ${{ + (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_action != 'init') || + (github.event_name == 'workflow_call' && inputs.deploy_action != 'init') || + (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call') + }} runs-on: ubuntu-latest + env: + PULUMI_CI: 'true' steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -104,8 +111,15 @@ jobs: apply: name: Apply to production stack needs: preview - if: ${{ env.DEPLOY_ACTION != 'init' }} + if: >- + ${{ + (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_action != 'init') || + (github.event_name == 'workflow_call' && inputs.deploy_action != 'init') || + (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call') + }} runs-on: ubuntu-latest + env: + PULUMI_CI: 'true' steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5