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
If issues/ already exists, the files from .github/ISSUE_TEMPLATE/ end up in issues/ISSUE_TEMPLATE/ instead of in issues/ as you would expect.
After investigating I found that the package used to copy files in this action, @actions/io, creates a new folder from the basename of the source path and copys the source files into it when the target directory already exists.
Here are the lines responsible for this behavior:
// If dest is an existing directory, should copy inside.constnewDest: string=destStat&&destStat.isDirectory()
? path.join(dest,path.basename(source))
: dest
I filed an issue (#741) in GitHub's Actions Toolkit repo and will wait a bit for their response. If this doesn't get addressed in a reasonable amount of time I will use another library, or the shell directly, to copy files/directories in this action.
Please let me know if you run into this problem as well or if you have another idea for a solution. Thanks!
The text was updated successfully, but these errors were encountered:
🐞 Describe the bug
I noticed a weird behavior when trying to sync two directories like this:
If
issues/
already exists, the files from.github/ISSUE_TEMPLATE/
end up inissues/ISSUE_TEMPLATE/
instead of inissues/
as you would expect.After investigating I found that the package used to copy files in this action,
@actions/io
, creates a new folder from the basename of the source path and copys the source files into it when the target directory already exists.Here are the lines responsible for this behavior:
From: https://github.com/actions/toolkit/blob/4dd900dde00dcc90e5c649b688c643b1fc7684a2/packages/io/src/io.ts#L47-L51
📋 Additional context
I filed an issue (#741) in GitHub's Actions Toolkit repo and will wait a bit for their response. If this doesn't get addressed in a reasonable amount of time I will use another library, or the shell directly, to copy files/directories in this action.
Please let me know if you run into this problem as well or if you have another idea for a solution. Thanks!
The text was updated successfully, but these errors were encountered: