Skip to content

Commit

Permalink
chore(prlint): get sha from context (#25457)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
corymhall authored May 5, 2023
1 parent c3744ae commit 6e73e66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/@aws-cdk/prlint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tools/@aws-cdk/prlint/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 6e73e66

Please sign in to comment.