Search code examples
githubcontinuous-integrationgithub-cli

Github CLI auto-create release notes


I have a github action I use to create releases, but I want to include release notes in each one automatically as well.

The end of my action runs this which is where I call the github gh CLI to create a new release:

# create a new release, and attach "*.zip" as extra artifacts.
- name: Create Github release with zip attached
  run: gh release create ${{ steps.date.outputs.date }} *.zip --target develop

There is a -n flag for "notes", but the docs show that as requiring a string - it does not auto-create release notes.

Is there a way to generate the release notes within my github action that will output the same thing that the Github web UI "Auto-Generate Release Notes" option does?


Solution

  • Looks like the current version (v2.3.0) doesn't have a way to do that, but a PR was merged 6 days ago (December 8, 2021) that adds a --generate-notes flag to gh release create. I'm not sure when it'll be released.

    https://github.com/cli/cli/pull/4467