From 789b76faa3726a4d7cea71dae0e8d29c77587481 Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Fri, 25 Oct 2024 15:15:55 +0800 Subject: [PATCH] fix: Fix milestone binding for closes issues when No close PR found (#78) --- nu/query.nu | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nu/query.nu b/nu/query.nu index 076f58d..42f53d8 100644 --- a/nu/query.nu +++ b/nu/query.nu @@ -55,12 +55,13 @@ def query-issue-status [issueNO: int, payload: string, token: string] { $events = $result.timeline.edges.node | filter {|it| $it.stateReason? | is-not-empty } - $closer = $events | filter {|it| $it.closer?.number? | is-not-empty } + let $closers = $events | filter {|it| $it.closer?.number? | is-not-empty } | select closer | flatten | select number milestone?.title? author.login repository.nameWithOwner mergeCommit.abbreviatedOid title | rename -c $rename - | last + $tries += 1 + $closer = if ($closers | is-empty) { {} } else { $closers | last } $milestone = $closer.milestone? | default '-' }