Add custom branch option

This commit is contained in:
Joppe De Cuyper 2025-07-16 08:19:24 +02:00
commit e1198c3769
No known key found for this signature in database
GPG key ID: 0757294DE10CE525
3 changed files with 19 additions and 7 deletions

View file

@ -124,15 +124,18 @@ async function dep() {
} catch (e) {
console.error('Invalid JSON in options')
}
let phpBin = 'php'
let phpBinArg = core.getInput('php-binary');
if (phpBinArg !== '') {
phpBin = phpBinArg
}
let branch = core.getInput('branch')
let branchOption = branch !== '' ? `--branch=${branch}` : ''
try {
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options} ${branchOption}`
} catch (err) {
core.setFailed(`Failed: dep ${cmd}`)
}