From a6636a21c465fbd3cea9827df9ae42a5221de919 Mon Sep 17 00:00:00 2001 From: Art <4998038+Alorel@users.noreply.github.com> Date: Sat, 21 Oct 2023 18:23:25 +0100 Subject: [PATCH] feat: Allow passing additional CLI args to the install command --- action.yml | 3 +++ index.js | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 89f0621..49a7135 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,9 @@ inputs: force-version: description: Force the given version if a different version is installed default: 'false' + flags: + description: Additional flags to pass on to the install command, one per line + required: false runs: using: node20 main: index.js diff --git a/index.js b/index.js index d7d93a5..3d44070 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -const {getInput, getBooleanInput, setFailed, info, notice} = require('@actions/core'); +const {getInput, getBooleanInput, setFailed, info, notice, getMultilineInput} = require('@actions/core'); const {spawnSync} = require('node:child_process'); try { @@ -7,6 +7,7 @@ try { const version = getInput('version'); const release = getBooleanInput('release'); const forceVersion = getBooleanInput('force-version'); + const flags = getMultilineInput('flags'); const alreadyInstalled = getInstalledVersion(name, binaryName); @@ -15,7 +16,7 @@ try { return; } - const args = ['install', name]; + const args = ['install', name, ...flags]; if (version) { args.push('--version', version); }