Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand All @@ -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}`);
}
Expand Down
17 changes: 12 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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 }>
Expand Down Expand Up @@ -129,13 +131,18 @@ async function dep(): Promise<void> {
}

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')
Expand All @@ -155,7 +162,7 @@ async function dep(): Promise<void> {
}

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}`)
}
Expand Down