You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, using fs.mkdir() on the root directory even with recursion will result in an error
With fs.mkdir which mkdirP uses for its impl, the EPERM error is expected when path is root directory even if it exists on Windows. Most of the third party actions which uses @actions/io does not account for this behaviour and calls mkdirP unconditionally without checking/handling the error. This is also the case with @actions/io, @actions/cache, @actions/artifact, @actions/tool-cache.
mkdirPshould behave consistently across platforms.
To Reproduce
Steps to reproduce the behavior:
Running below snippet would lead to error:
Describe the bug
io.mkdirP
throws EPERM: operation not permitted error for root directories (e.g.C:\
) on Windows even if it already exists.In the node's official docs:
With
fs.mkdir
which mkdirP uses for its impl, the EPERM error is expected when path is root directory even if it exists on Windows. Most of the third party actions which uses@actions/io
does not account for this behaviour and callsmkdirP
unconditionally without checking/handling the error. This is also the case with @actions/io, @actions/cache, @actions/artifact, @actions/tool-cache.mkdirP
should behave consistently across platforms.To Reproduce
Steps to reproduce the behavior:
Running below snippet would lead to error:
Expected behavior
mkdirP
shouldn't throw if path already exists (this is already true for Linux).Screenshots
using "actions/download-artifact" (which internally uses
io.mkdirP
) fails to run when path isC:\
, orD:\
:for a job step:
The text was updated successfully, but these errors were encountered: