From 32582809a1d97604595094b5e221f0a4ebd5c08d Mon Sep 17 00:00:00 2001 From: WDI-Ideas Date: Wed, 8 Apr 2026 20:01:15 +0530 Subject: [PATCH] fix(ci): align workflow_call inputs across central and deploy workflows Pass missing branch_name/pm2_id to deploy workflow, add matching deploy inputs, and harden run_* conditions to support both boolean and string true/false values. Made-with: Cursor --- .gitea/workflows/ci.yml | 19 ++++++++++------ .gitea/workflows/deploy.yml | 45 ++++++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 1edd3f8..4e2c70e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -5,16 +5,16 @@ on: inputs: run_build: type: string - default: true + default: 'true' run_sonar: type: string - default: true + default: 'true' run_deploy: type: string - default: false + default: 'false' wait_for_quality_gate: type: string - default: true + default: 'true' tech_stack: type: string required: true @@ -41,6 +41,9 @@ on: runtime: type: string required: false + pm2_id: + type: string + required: false secrets: SONAR_HOST_URL: @@ -85,7 +88,7 @@ jobs: # 🔨 BUILD build: - if: inputs.run_build == 'true' + if: inputs.run_build == true || inputs.run_build == 'true' uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/build.yml@main with: tech_stack: ${{ inputs.tech_stack }} @@ -93,7 +96,7 @@ jobs: # 🔍 SONAR sonar: - if: inputs.run_sonar == 'true' + if: inputs.run_sonar == true || inputs.run_sonar == 'true' needs: build uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/quality.yml@main with: @@ -104,11 +107,13 @@ jobs: # 🚀 DEPLOY deploy: - if: inputs.run_deploy == 'true' + if: inputs.run_deploy == true || inputs.run_deploy == 'true' needs: [build, sonar] uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/deploy.yml@main with: tech_stack: ${{ inputs.tech_stack }} + branch_name: ${{ github.ref_name }} + pm2_id: ${{ inputs.pm2_id }} deploy_command: ${{ inputs.deploy_command }} app_path_beta: ${{ inputs.app_path_beta }} app_path_testing: ${{ inputs.app_path_testing }} diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index b95e126..6b84a80 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -13,12 +13,18 @@ on: app_path_beta: required: false type: string + app_path_testing: + required: false + type: string app_path_staging: required: false type: string app_path_prod: required: false type: string + deploy_command: + required: false + type: string pm2_id: required: false @@ -77,7 +83,11 @@ jobs: script: | set -xe - cd ${{ inputs.app_path_beta }} + if [ "${{ inputs.branch_name }}" = "testing" ] && [ -n "${{ inputs.app_path_testing }}" ]; then + cd ${{ inputs.app_path_testing }} + else + cd ${{ inputs.app_path_beta }} + fi git fetch git reset --hard origin/${{ inputs.branch_name }} @@ -85,9 +95,14 @@ jobs: case "${{ inputs.tech_stack }}" in node|react|nestjs) - npm install - npm run build || true - pm2 reload ${{ inputs.pm2_id }} || true + if [ -n "${{ inputs.deploy_command }}" ]; then + echo "Running custom deploy command" + ${{ inputs.deploy_command }} + else + npm install + npm run build || true + pm2 reload ${{ inputs.pm2_id }} || true + fi ;; docker) docker compose up -d --build @@ -119,9 +134,14 @@ jobs: case "${{ inputs.tech_stack }}" in node|react|nestjs) - npm install - npm run build || true - pm2 reload ${{ inputs.pm2_id }} || true + if [ -n "${{ inputs.deploy_command }}" ]; then + echo "Running custom deploy command" + ${{ inputs.deploy_command }} + else + npm install + npm run build || true + pm2 reload ${{ inputs.pm2_id }} || true + fi ;; docker) docker compose up -d --build @@ -153,9 +173,14 @@ jobs: case "${{ inputs.tech_stack }}" in node|react|nestjs) - npm install - npm run build || true - pm2 reload ${{ inputs.pm2_id }} || true + if [ -n "${{ inputs.deploy_command }}" ]; then + echo "Running custom deploy command" + ${{ inputs.deploy_command }} + else + npm install + npm run build || true + pm2 reload ${{ inputs.pm2_id }} || true + fi ;; docker) docker compose up -d --build