Extracting an archive to a root subfolder fails with ENOENT
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Extracting an archive to a root subfolder fails with NOENT.
Using the following typescript code,
const tar_path = await tc.downloadTool(SOME_URL);
const location = "/location";
core.info(`Archive downloaded to ${tar_path}.`);
const extract_location = await tc.extractTar(tar_path, location);
core.info(`Archive extracted to ${extract_location}.`);
a consumer fails with:
Archive downloaded to /home/runner/work/_temp/e87a9e79-45b6-4f14-9d50-6e13043a11c5.
Error: ENOENT: no such file or directory, mkdir
To Reproduce
Steps to reproduce the behavior:
- Create an action that uses tool cache, downloads an archive and extracts to a root subfolder
- Create a workflow that uses this action
- Run this action
- Error
A github action that suffers from this problem is my WIP setup-watcom.
A consumer of this github action is watcom-cmake.
(The reproducers are currently on the experimental branch. the master branch works around this issue by extracting the toolchain to the current working directory)
This github action log shows the error message.
Expected behavior
The tar is extracted to the root subfolder, and is ready for use.
Screenshots

Additional context
The same action works on Windows, which extracts the toolchain to a direct subfolder of C:\.
The error is not EACCESS, so I think this is not a permission error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the extractTar entry point used in the TypeScript example and reproduce the failure with an absolute root-subfolder destination. Compare the behavior with the Windows case and the linked action log; done means the archive extracts successfully to the requested root subfolder without ENOENT.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100