From d83521e8b41c464ae2e1821d0162c276a84e1c28 Mon Sep 17 00:00:00 2001 From: Christian Grail Date: Mon, 9 Sep 2024 14:49:26 +0200 Subject: [PATCH] Update commentPullRequest.ts --- scripts/utils/commentPullRequest.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/utils/commentPullRequest.ts b/scripts/utils/commentPullRequest.ts index 5cf7d0cf4..ff6f58a01 100644 --- a/scripts/utils/commentPullRequest.ts +++ b/scripts/utils/commentPullRequest.ts @@ -2,7 +2,6 @@ import * as github from '@actions/github'; import { Octokit } from '@octokit/rest'; import { ErrorDetail } from './ErrorDetail'; import getPrBranchUrl from './getPrBranchUrl'; -import { ReorderError } from './ReorderError'; export default async function commentPullRequest(token: string, allErrors: ErrorDetail[], duplicateErrorMessages: string[], error?: Error) { const { context: eventContext } = github; @@ -21,7 +20,7 @@ export default async function commentPullRequest(token: string, allErrors: Error body: error.message.replace('scripts/config/validLocations.ts', `[scripts/config/validLocations.ts](${prBranchUrl}/scripts/config/validLocations.ts)`) }; }); - if (error instanceof ReorderError) { + if (error && error instanceof Error) { await octokit.issues.createComment({ owner: eventContext.repo.owner, repo: eventContext.repo.repo,