Hotfix: check org and repo for linked issue#789
Hotfix: check org and repo for linked issue#789wannacfuture wants to merge 5 commits intoubiquity:developmentfrom
Conversation
✅ Deploy Preview for ubiquibot-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
… into feat/check-org-and-repo-for-linked-issue
|
QA: https://github.com/wannacfuture/Battleship/pull/36 (see linked issues if they are assigned correctly) |
| const issue = await getIssueByNumber(context, +linkedIssueNumber); | ||
| if (!issue?.assignees) continue; | ||
| const issue = await getIssueByNumber(context, +linkedIssueNumber); | ||
| if (!issue?.assignees) continue; |
There was a problem hiding this comment.
If there's no assignee, we don't need to assign the opener of the linked PR to the issue?
There was a problem hiding this comment.
It doesn't mean there is no assinee.
It just wants to make sure if assinees field exists on the issue not if(issue?.assignees.length === 0)
There was a problem hiding this comment.
Sounds like the same thing. No assignee means the assignees field doesn't exist, right?
There was a problem hiding this comment.
No assignee means assignees field is empty array, not undefined.
There was a problem hiding this comment.
this if statement will only execute if assignees is undefined or null, but not if its empty array. github should always send empty array if there's no assignees but if they don't send the field, this could possibly be a bug.
There was a problem hiding this comment.
Exactly. we need to go on, to assign the author of the linked PR to the issue if assignees is empty array.
If it is undefined or null, it should skip the loop.
Resolves #666