actions / actions/toolkit

Unable to mount docker to $(pwd) [exec]

Open
#490 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug exec
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When mounting docker to $(pwd) with exec, the action failed and I got:

/usr/bin/docker: Error response from daemon: create $(pwd): "$(pwd)" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.

Command called:

const cmd= "docker run -v $(pwd):/tmp tiagogouvea/dpl:v1.10.15 --provider='heroku' ";
await exec.exec(cmd);

ℹ️ Running the same command using child_process.execSync works. Example:

const cmd= "docker run -v $(pwd):/tmp tiagogouvea/dpl:v1.10.15 --provider='heroku' ";
execSync(cmd);

To Reproduce
Steps to reproduce the behavior:

  1. Create a action with JavaScript
  2. Call await exec.exec("docker run -v $(pwd):/tmp tiagogouvea/dpl:v1.10.15");

Expected behavior

  • Want to mount the current path to as docker volume.
  • Wanted to @actions/exec work like child_process/execSync.

Desktop (please complete the following information):

  • OS: runs-on: ubuntu-latest

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the @actions/exec entry point used by exec.exec and compare its command handling with Node's child_process.execSync, using the Docker command and error in the report as the reproduction. Done means the documented current-path Docker volume command behaves as expected, with coverage or clarified behavior for shell command substitution.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, node.js, typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.