From 6e73e661a5901ca89b73dd76db13bb264dfd7576 Mon Sep 17 00:00:00 2001 From: Cory Hall <43035978+corymhall@users.noreply.github.com> Date: Fri, 5 May 2023 10:21:30 -0400 Subject: [PATCH] chore(prlint): get sha from context (#25457) The `sha` doesn't exist in some of the payloads, but should always exist in the event context. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- tools/@aws-cdk/prlint/index.ts | 2 +- tools/@aws-cdk/prlint/lint.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/@aws-cdk/prlint/index.ts b/tools/@aws-cdk/prlint/index.ts index 269f2cd47a37a..ef6f9dbdff06a 100644 --- a/tools/@aws-cdk/prlint/index.ts +++ b/tools/@aws-cdk/prlint/index.ts @@ -29,7 +29,7 @@ async function run() { repo: github.context.repo.repo, number: github.context.issue.number, }); - await prLinter.validatePullRequestTarget(github.context.payload.sha); + await prLinter.validatePullRequestTarget(github.context.sha); } } catch (error: any) { core.setFailed(error.message); diff --git a/tools/@aws-cdk/prlint/lint.ts b/tools/@aws-cdk/prlint/lint.ts index 9083954bad249..2054e8b60a06b 100644 --- a/tools/@aws-cdk/prlint/lint.ts +++ b/tools/@aws-cdk/prlint/lint.ts @@ -453,7 +453,7 @@ export class PullRequestLinter { await this.assessNeedsReview(pr); } } catch (e) { - console.log('assessing review failed: ', e); + console.log(`assessing review failed for sha ${sha}: `, e); } }