mirror of
https://forgejo.merr.is/annika/actions-docker-extract.git
synced 2025-12-11 13:02:12 -05:00
Trying To Add The Ability To Specify The Shell Command Used
This commit is contained in:
parent
15c8bf3149
commit
8f00ad1f71
1 changed files with 2 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ const exec = require('@actions/exec');
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
|
const shell = core.getInput('shell_command') || "/bin/bash -c";
|
||||||
const image = core.getInput('image');
|
const image = core.getInput('image');
|
||||||
const path = core.getInput('path');
|
const path = core.getInput('path');
|
||||||
const destination = core.getInput('destination') || `.extracted-${Date.now()}`;
|
const destination = core.getInput('destination') || `.extracted-${Date.now()}`;
|
||||||
|
|
@ -10,7 +11,7 @@ async function run() {
|
||||||
const create = `docker cp $(docker create ${image}):/${path} ${destination}`;
|
const create = `docker cp $(docker create ${image}):/${path} ${destination}`;
|
||||||
|
|
||||||
await exec.exec(`mkdir -p ${destination}`);
|
await exec.exec(`mkdir -p ${destination}`);
|
||||||
await exec.exec(`/bin/bash -c "${create}"`, []);
|
await exec.exec(`${shell} "${create}"`, []);
|
||||||
|
|
||||||
core.setOutput('destination', destination);
|
core.setOutput('destination', destination);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue