Skip to content

Commit

Permalink
fix: ignore sending slack message when assigned by reviewflow
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Mar 13, 2022
1 parent 71080e6 commit 0e9d5a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/events/pr-handlers/assignedOrUnassigned.ts
Expand Up @@ -2,6 +2,7 @@ import type { Probot } from 'probot';
import type { AppContext } from '../../context/AppContext';
import * as slackUtils from '../../slack/utils';
import { createPullRequestHandler } from './utils/createPullRequestHandler';
import { checkIfIsThisBot } from './utils/isBotUser';

export default function assignedOrUnassignedHandler(
app: Probot,
Expand All @@ -12,6 +13,10 @@ export default function assignedOrUnassignedHandler(
appContext,
['pull_request.assigned', 'pull_request.unassigned'],
(payload, context, repoContext) => {
if (checkIfIsThisBot(payload.sender)) {
// ignore assigned from this bot
return null;
}
return payload.pull_request;
},
async (
Expand Down

0 comments on commit 0e9d5a7

Please sign in to comment.