diff --git a/dist/index.js b/dist/index.js index 7c8fc43..e20110d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -45608,6 +45608,9 @@ async function downloadBuf(version) { // limitations under the License. +// oldCommentTag is the previous tag used to identify the comment. This is +// temporary and will be removed in a future release. +const oldCommentTag = ""; // commentTag returns the tag used to identify the comment. This is a non-visible // string injected into the comment body. It is unique to the workflow and job. function commentTag() { @@ -45628,7 +45631,10 @@ async function findCommentOnPR(context, github) { repo: repo, issue_number: prNumber, }); - const previousComment = comments.find((comment) => comment.body?.includes(commentTag())); + const tag = commentTag(); + const previousComment = comments.find((comment) => + // TODO: Remove the old comment tag check in a future release. + comment.body?.includes(tag) || comment.body?.includes(oldCommentTag)); if (previousComment) { core.info(`Found previous comment ${previousComment.id}`); return previousComment.id; diff --git a/src/comment.ts b/src/comment.ts index 1643536..73c93e0 100644 --- a/src/comment.ts +++ b/src/comment.ts @@ -17,6 +17,10 @@ import { context } from "@actions/github"; import { Context } from "@actions/github/lib/context"; import { GitHub } from "@actions/github/lib/utils"; +// oldCommentTag is the previous tag used to identify the comment. This is +// temporary and will be removed in a future release. +const oldCommentTag = ""; + // commentTag returns the tag used to identify the comment. This is a non-visible // string injected into the comment body. It is unique to the workflow and job. function commentTag(): string { @@ -41,8 +45,11 @@ export async function findCommentOnPR( repo: repo, issue_number: prNumber, }); - const previousComment = comments.find((comment) => - comment.body?.includes(commentTag()), + const tag = commentTag(); + const previousComment = comments.find( + (comment) => + // TODO: Remove the old comment tag check in a future release. + comment.body?.includes(tag) || comment.body?.includes(oldCommentTag), ); if (previousComment) { core.info(`Found previous comment ${previousComment.id}`);