Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Bugfix - Deactivate comenting on bot PRs #388

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/api/actions/github/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ export async function POST(request: Request) {

const octokit = await app.getInstallationOctokit(installationId);

if (pull_request.user.type === "Bot") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it uppercase?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's uppercase. You can verify that by trying this out with a lowercase on watermelontools/watermelon-intellij#66

return new Response("We don't comment on bot PRs", {
status: 400
});
}

let octoCommitList = await octokit.request(
"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
{
Expand Down