Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb committed Oct 22, 2023
1 parent 8f33ebe commit ec0f74c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
13 changes: 7 additions & 6 deletions src/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ export const pushImages = async (input: PushImagesInput) => {
const s = err.toString();
/* istanbul ignore if */
if (s.indexOf("Couldn't find remote ref") === -1) {
log.error("[warning] Failed to fetch target branch, probably doesn't exist");
log.warn("Failed to fetch target branch, probably doesn't exist");
log.error(err);
}
});
Expand Down Expand Up @@ -532,12 +532,13 @@ export const pushImages = async (input: PushImagesInput) => {
// return ['**/*', '!.git'];
// }
// })();
if (!hasBranch) {
const filesToDelete = fgStream(globs, { absolute: true, dot: true, followSymbolicLinks: false, cwd: REPO_TEMP });

const filesToDelete = fgStream(globs, { absolute: true, dot: true, followSymbolicLinks: false, cwd: REPO_TEMP });

// Delete all files from the filestream
for await (const entry of filesToDelete) {
await fs.unlink(entry);
// Delete all files from the filestream
for await (const entry of filesToDelete) {
await fs.unlink(entry);
}
}

// const sourceDir = path.resolve(process.cwd(), config.sourceDir);
Expand Down
28 changes: 12 additions & 16 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,20 @@ export const run = async (event: Event, runId: number, sha: string, client: Clie
branch: 'reg',
targetDir: `${runId}_${config.artifactName}`,
env: process.env,
commitName: undefined,
commitEmail: undefined,
// commitName: undefined,
// commitEmail: undefined,
});
}

setTimeout(async () => {
const comment = createCommentWithTarget({
event,
runId,
sha,
targetRun,
result,
artifactName: config.artifactName,
regBranch: 'reg',
});
const comment = createCommentWithTarget({
event,
runId,
sha,
targetRun,
result,
artifactName: config.artifactName,
regBranch: 'reg',
});

if (event.number != null) {
await client.postComment(event.number, comment);
}
}, 10000);
await client.postComment(event.number, comment);
};

0 comments on commit ec0f74c

Please sign in to comment.