Skip to content

Commit

Permalink
Ignore all bots (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored May 15, 2024
1 parent e3855ed commit 4c09fae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/anyRepoHandlePullRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const generatePRInfo = async (api: Octokit, payload: PullRequestEvent, logger: L
return {
thisIssue,
authorIsMemberOfTSTeam,
authorIsTypescriptBot: payload.pull_request.user.login === "typescript-bot",
authorIsBot: payload.pull_request.user.type === "Bot",
relatedIssues,
comments
}
Expand Down
2 changes: 1 addition & 1 deletion src/checks/addCommentToUncommittedPRs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe(addCommentToUncommittedPRs, () => {
const pr = getPRFixture("opened")
pr.pull_request.user.login = "typescript-bot"

const info = createPRInfo({ authorIsTypescriptBot: true })
const info = createPRInfo({ authorIsBot: true })
await addCommentToUncommittedPRs(api, pr, getFakeLogger(), info)

expect(mockAPI.issues.createComment).not.toHaveBeenCalled()
Expand Down
2 changes: 1 addition & 1 deletion src/checks/addCommentToUncommittedPRs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Logger } from "../util/logger"
* Comment on new PRs that don't have linked issues, or link to uncommitted issues.
*/
export const addCommentToUncommittedPRs = async (api: Octokit, payload: PullRequestEvent, logger: Logger, info: PRInfo) => {
if (payload.pull_request.merged || payload.pull_request.draft || info.authorIsMemberOfTSTeam || info.authorIsTypescriptBot) {
if (payload.pull_request.merged || payload.pull_request.draft || info.authorIsMemberOfTSTeam || info.authorIsBot) {
return logger.trace("Skipping")
}

Expand Down
2 changes: 1 addition & 1 deletion src/util/tests/createPRInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const createPRInfo = (info?: Partial<PRInfo>): PRInfo => {
return {
comments: [],
authorIsMemberOfTSTeam: false,
authorIsTypescriptBot: false,
authorIsBot: false,
relatedIssues: [],
thisIssue: {
issue_number: 35454,
Expand Down

0 comments on commit 4c09fae

Please sign in to comment.