Trying To Add The Ability To Specify The Shell Command Used

This commit is contained in:
Annika Merris 2024-02-03 18:52:00 -05:00
parent 15c8bf3149
commit 8f00ad1f71

View file

@ -3,6 +3,7 @@ const exec = require('@actions/exec');
async function run() {
try {
const shell = core.getInput('shell_command') || "/bin/bash -c";
const image = core.getInput('image');
const path = core.getInput('path');
const destination = core.getInput('destination') || `.extracted-${Date.now()}`;
@ -10,7 +11,7 @@ async function run() {
const create = `docker cp $(docker create ${image}):/${path} ${destination}`;
await exec.exec(`mkdir -p ${destination}`);
await exec.exec(`/bin/bash -c "${create}"`, []);
await exec.exec(`${shell} "${create}"`, []);
core.setOutput('destination', destination);
} catch (error) {