diff --git a/lib/main.js b/lib/main.js index 86cee9b..3f2bc9f 100644 --- a/lib/main.js +++ b/lib/main.js @@ -63,9 +63,10 @@ function run() { const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'github-pages-')); process.chdir(tmpdir); core.info(`🏃 Copying ${path.resolve(build_dir)} contents to ${tmpdir}`); - ncp_1.default.ncp(path.resolve(build_dir), tmpdir, {}, err => { - core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`); - return; + ncp_1.default.ncp(path.resolve(build_dir), tmpdir, err => { + if (err !== null) { + core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`); + } }); const remote_branch_exists = child_process.execSync(`git ls-remote --heads ${remote_url} ${target_branch}`, { encoding: 'utf8' }).trim().length > 0; diff --git a/src/main.ts b/src/main.ts index 91f6398..e6d685b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -45,9 +45,10 @@ async function run() { process.chdir(tmpdir); core.info(`🏃 Copying ${path.resolve(build_dir)} contents to ${tmpdir}`); - ncp.ncp(path.resolve(build_dir), tmpdir, {}, err => { - core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`); - return; + ncp.ncp(path.resolve(build_dir), tmpdir, err => { + if (err !== null) { + core.setFailed(`⛔️ Failed to copy ${path.resolve(build_dir)}`); + } }); const remote_branch_exists =