From 68818ee86df61bf707f718ae8e4c57c878bf7bd5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 09:06:09 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20deploy=20silently=20no-ops=20after=20zx?= =?UTF-8?q?=207=E2=86=928=20upgrade=20(#99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two breaking changes from the zx 7→8 upgrade caused this regression: 1. zx 8 defaults verbose to false (was true in zx 7), suppressing all command output from the Actions log. Fix: set $.verbose = true. 2. zx 8's quote("") returns $'' (explicit empty shell argument) instead of "" (which vanished in the command string). When the optional recipe input is empty, this passed an unwanted empty argument to Deployer, causing it to silently no-op. Fix: use arrays for optional args (recipe, verbosity) so empty values produce no arguments. Agent-Logs-Url: https://github.com/deployphp/action/sessions/9f7b96de-ce5c-4f32-baac-23aa7b69e161 Co-authored-by: antonmedv <141232+antonmedv@users.noreply.github.com> --- dist/index.js | 12 ++++++++---- src/index.ts | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/dist/index.js b/dist/index.js index adfee3a..fe6c47f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -36631,6 +36631,7 @@ var import_build = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((expo var { VERSION, YAML, argv, dotenv, echo, expBackoff, fetch, fs, glob, globby, minimist, nothrow, parseArgv, question, quiet, retry, sleep, spinner, stdin, tempdir, tempfile, tmpdir, tmpfile, updateArgv, version, versions, $, Fail, ProcessOutput, ProcessPromise, bus, cd, chalk, defaults, kill, log, os: os$1, path, ps, quote, quotePowerShell, resolveDefaults, syncProcessCwd, useBash, usePowerShell, usePwsh, which, within } = globalThis.Deno ? globalThis.require("./index.cjs") : import_build; //#endregion //#region src/index.ts +$.verbose = true; (async function main() { try { await ssh(); @@ -36707,10 +36708,13 @@ async function dep() { bin = "deployer.phar"; } const cmd = getInput("dep").split(" "); - let recipe = getInput("recipe"); - if (recipe !== "") recipe = `--file=${recipe}`; + const recipeArgs = []; + const recipeInput = getInput("recipe"); + if (recipeInput !== "") recipeArgs.push(`--file=${recipeInput}`); const ansi = getBooleanInput("ansi") ? "--ansi" : "--no-ansi"; - const verbosity = getInput("verbosity"); + const verbosityArgs = []; + const verbosityInput = getInput("verbosity"); + if (verbosityInput !== "") verbosityArgs.push(verbosityInput); const options = []; try { const optionsArg = getInput("options"); @@ -36722,7 +36726,7 @@ async function dep() { const phpBinArg = getInput("php-binary"); if (phpBinArg !== "") phpBin = phpBinArg; try { - await $`${phpBin} ${bin} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`; + await $`${phpBin} ${bin} ${cmd} ${recipeArgs} --no-interaction ${ansi} ${verbosityArgs} ${options}`; } catch (err) { setFailed(`Failed: dep ${cmd}`); } diff --git a/src/index.ts b/src/index.ts index 4247256..3864887 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ import * as core from '@actions/core' import { $, fs, cd } from 'zx' +$.verbose = true + interface ComposerLock { packages?: Array<{ name: string; version: string }> 'packages-dev'?: Array<{ name: string; version: string }> @@ -129,13 +131,18 @@ async function dep(): Promise { } const cmd = core.getInput('dep').split(' ') - let recipe = core.getInput('recipe') - if (recipe !== '') { - recipe = `--file=${recipe}` + const recipeArgs: string[] = [] + const recipeInput = core.getInput('recipe') + if (recipeInput !== '') { + recipeArgs.push(`--file=${recipeInput}`) } const ansi = core.getBooleanInput('ansi') ? '--ansi' : '--no-ansi' - const verbosity = core.getInput('verbosity') + const verbosityArgs: string[] = [] + const verbosityInput = core.getInput('verbosity') + if (verbosityInput !== '') { + verbosityArgs.push(verbosityInput) + } const options: string[] = [] try { const optionsArg = core.getInput('options') @@ -155,7 +162,7 @@ async function dep(): Promise { } try { - await $`${phpBin} ${bin} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}` + await $`${phpBin} ${bin} ${cmd} ${recipeArgs} --no-interaction ${ansi} ${verbosityArgs} ${options}` } catch (err) { core.setFailed(`Failed: dep ${cmd}`) }