mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
Script to generate the excerpt of the GH release (#566)
* Script to generate the excerpt of the GH release This will add a list of PR authors so they will be shown with a profile image at the end of the GH release. * Update make_release/release-note/gh-release-excerpt Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com> * Sort authors, feeks default release cycle --------- Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>
This commit is contained in:
parent
459b8c9d4f
commit
f2e35e153c
1 changed files with 42 additions and 0 deletions
42
make_release/release-note/gh-release-excerpt
Executable file
42
make_release/release-note/gh-release-excerpt
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env nu
|
||||
|
||||
|
||||
# Prepare the GitHub release text
|
||||
def main [
|
||||
versionname: string # The version we release now
|
||||
bloglink: string # The link to the blogpost
|
||||
date?: datetime # the date of the last release (default to 3 weeks ago, excluded)
|
||||
] {
|
||||
let date = (
|
||||
if $date == null { (date now) - 4wk + 1day } else { $date }
|
||||
| format date "%Y-%m-%d"
|
||||
)
|
||||
|
||||
let repo = "nushell/nushell"
|
||||
let query = $"merged:>($date)"
|
||||
|
||||
let prs = (
|
||||
gh --repo $repo pr list
|
||||
--state merged
|
||||
--limit (inf | into int)
|
||||
--json author,title,number,mergedAt,url
|
||||
--search $query
|
||||
| from json
|
||||
| sort-by mergedAt --reverse
|
||||
| update author { get login }
|
||||
)
|
||||
|
||||
let authors = $prs.author | uniq | sort -i
|
||||
|
||||
let author_string = ($authors | each {|name| $"@($name)"} | str join ", " )
|
||||
|
||||
let release_text = [
|
||||
$"This is the ($versionname) release of Nushell. You can learn more about this release here: ($bloglink)",
|
||||
"",
|
||||
"For convenience, we are providing full builds for Windows, Linux, and macOS. Be sure you have the requirements to enable all capabilities: https://www.nushell.sh/book/installation.html#dependencies",
|
||||
"",
|
||||
$"This release was made possible by PR contributions from ($author_string)"
|
||||
]
|
||||
|
||||
$release_text | str join "\n"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue