Skip to content

Commit

Permalink
feat: Allow passing additional CLI args to the install command
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Oct 21, 2023
1 parent 8ff030b commit a6636a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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);

Expand All @@ -15,7 +16,7 @@ try {
return;
}

const args = ['install', name];
const args = ['install', name, ...flags];
if (version) {
args.push('--version', version);
}
Expand Down

0 comments on commit a6636a2

Please sign in to comment.