Skip to content

Commit

Permalink
move it to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisBrunner committed Dec 5, 2024
1 parent dfe98c9 commit bb15f1f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,18 @@ export const createRun = async (
};

const commentLocator = (label?: string): string => {
return `<!-- Diff Action / Pull Request Comment / ${label ?? ''} -->
`;
return `<!-- Diff Action / Pull Request Comment / ${label ?? ''} -->`;
};

const commentBody = (label: string | undefined, result: Result): string => {
return `${commentLocator(label)}## ${getTitle(label)}: ${result.passed ? 'Success' : 'Failure'}
return `## ${getTitle(label)}: ${result.passed ? 'Success' : 'Failure'}
${result.summary}
\`\`\`
${result.output}
\`\`\`
`;
${commentLocator(label)}`;
};

const createComment = async (
Expand Down Expand Up @@ -93,7 +92,7 @@ const findComment = async (
issue_number: context.issue.number,
})) {
for (const comment of entry.data) {
if (comment.body?.startsWith(locator) && comment.user?.login === viewer.login) {
if (comment.body?.endsWith(locator) && comment.user?.login === viewer.login) {
return comment.id;
}
}
Expand Down

0 comments on commit bb15f1f

Please sign in to comment.