Skip to content

Instantly share code, notes, and snippets.

@duboisf
Created June 11, 2025 17:15
Show Gist options
  • Save duboisf/8f35c4ad3ac7027295fc48fa453cff0b to your computer and use it in GitHub Desktop.
Save duboisf/8f35c4ad3ac7027295fc48fa453cff0b to your computer and use it in GitHub Desktop.
Generate a changelog on the fly for a github repo based on releases with nu and the gh cli

In nushell, you can generate a changelog on the fly with the following:

gh release list --json name
| from json
| get name
| par-each --keep-order { |name|
    gh release view $name --json name,body,author
    | from json
    | $"# ($in.name) by ($in.author.login)\n\n($in.body)"
}
| str join "\n"

You can also add it to your gh config (usually located at ~/.config/gh/config.yml):

aliases:
    changelog: |
        !nu -c '
          gh release list --json name
          | from json
          | get name
          | par-each --keep-order { |name|
              gh release view $name --json name,body,author
              | from json
              | $"# ($in.name) by ($in.author.login)\n\n($in.body)"
          }
          | str join "\n"
        '

So that you can easily invoke it with gh changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment