Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix set milestone to issue, close #20 #46

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions nu/milestone.nu
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,11 @@ export def guess-milestone-for-issue [
repo: string, # Github repository name
issueNO: string, # Issue number
] {
let pr = gh api $'/repos/($repo)/issues/($issueNO)/timeline'
| from json
| where event == closed
| filter { $in.commit_id | is-not-empty }
| get 0.commit_url
| gh api $in
| from json
| get commit.message
| lines
| first
| parse --regex '\(#(?<pr>\d+)\)'
let pr = http get $'https://github.com/($repo)/issues/($issueNO)'
| query web --query 'span[data-issue-and-pr-hovercards-enabled]'
| get 0 | to text
| str trim | lines | str join
| parse --regex '#(?<pr>\d+)'
| get pr.0

let milestone = gh pr view --repo $repo $pr --json 'milestone'
Expand Down