fix(webhook): ignore bare issue references for xp awards#235
Conversation
|
@Sujini-kudupudi is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
hey @Sujini-kudupudi, two notes while you're already in this regex. 1. const ISSUE_REF = /(?:close[sd]?|fix(?:e[sd]?)?|resolve[sd]?)\s+#(\d+)/gi;add a test for it: 2. you've bundled the related: there's a third site of the same regex change itself is the right call. once the |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
This PR fixes a bug where any bare issue reference (e.g.,
#42) in a pull request body or title would incorrectly trigger XP awards as if the PR had closed the issue. It restricts the regex to only match issue numbers preceded by closing keywords.Type of Change
Related Issue
Closes #217
What was changed?
|#(\d+)from theISSUE_REFregex insrc/inngest/functions/process-pr-event.ts.extractIssueNumbersto only extract the first capture group.src/inngest/functions/process-pr-event.test.tsto assert that bare#Nreferences correctly return an empty array and are ignored, avoiding false positive XP awards.Screenshots
N/A
Checklist
npm run dev)