From 01ecc4d40e7c31c122b804709677baf666b2b4f4 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Sun, 22 Oct 2023 20:47:13 +0900 Subject: [PATCH] fix --- src/comment.ts | 9 +++++++-- src/service.ts | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/comment.ts b/src/comment.ts index bb7ddfbb..31cd3ba9 100644 --- a/src/comment.ts +++ b/src/comment.ts @@ -19,6 +19,7 @@ export type CreateCommentWithoutTargetInput = { event: Event; runId: number; result: CompareOutput; + artifactName: string; }; const isSuccess = (result: CompareOutput) => { @@ -134,6 +135,8 @@ export const createCommentWithTarget = ({ const baseUrl = createBaseUrl({ owner, repoName, branch: regBranch, runId, artifactName, date }); const successOrFailMessage = isSuccess(result) ? `${badge(result)} + +## ${artifactName} ✨✨ That's perfect, there is no visual difference! ✨✨ ` @@ -163,8 +166,10 @@ ${deletedItems({ result, baseUrl })} return body; }; -export const createCommentWithoutTarget = ({ result }: CreateCommentWithoutTargetInput): string => { - const body = `Failed to find a target artifact. +export const createCommentWithoutTarget = ({ result, artifactName }: CreateCommentWithoutTargetInput): string => { + const body = `## ${artifactName} + +Failed to find a target artifact. All items will be treated as new items and will be used as expected data for the next time. ![target not found](https://img.shields.io/badge/%E2%9C%94%20reg-new%20items-blue) diff --git a/src/service.ts b/src/service.ts index bc0ddca8..6bdf706c 100644 --- a/src/service.ts +++ b/src/service.ts @@ -153,7 +153,7 @@ export const run = async ({ // If we have current run, add comment to PR. if (runId) { - const comment = createCommentWithoutTarget({ event, runId, result }); + const comment = createCommentWithoutTarget({ event, runId, result, artifactName: config.artifactName }); await client.postComment(event.number, comment); } return;