Skip to content

Commit

Permalink
Update commentPullRequest.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrail committed Sep 9, 2024
1 parent 7571864 commit d83521e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/utils/commentPullRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit d83521e

Please sign in to comment.