Skip to content

Commit

Permalink
feat: improve regex
Browse files Browse the repository at this point in the history
  • Loading branch information
whilefoo committed Sep 24, 2023
1 parent 2df5613 commit 660e205
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/handlers/payout/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export const incentivesCalculation = async (): Promise<IncentivesCalculationResu
const comments = await getAllIssueComments(issue.number);

const wasReopened = await wasIssueReopened(issue.number);
const claimUrlRegex = new RegExp(`\\((${permitBaseUrl}\\?claim=\\S+)\\)`);
const permitCommentIdx = comments.findIndex((e) => e.user.type === UserType.Bot && e.body.match(claimUrlRegex));
const claimUrlRegex = new RegExp(`\\((${permitBaseUrl}\\S+)\\)`);
const permitCommentIdx = comments.findIndex((e) => e.user.type === UserType.Bot && e.body.match(claimUrlRegex) && e.body.includes("Task Assignee Reward"));

if (wasReopened && permitCommentIdx !== -1) {
const permitComment = comments[permitCommentIdx];
Expand Down

0 comments on commit 660e205

Please sign in to comment.