diff --git a/src/git-utils.ts b/src/git-utils.ts index 43c43866e..2531043d6 100644 --- a/src/git-utils.ts +++ b/src/git-utils.ts @@ -57,7 +57,11 @@ export async function copyAssets( } core.info(`[INFO] copy ${publishDir} to ${destDir}`); - cp('-RfL', [`${publishDir}/*`, `${publishDir}/.*`], destDir); + const sourceDir = [`${publishDir}/*`]; + if (fs.readdirSync(publishDir).some(ele => ele.startsWith('.'))) { + sourceDir.push(`${publishDir}/.*`); + } + cp('-RfL', sourceDir, destDir); await deleteExcludedAssets(destDir, excludeAssets);