2

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?

FirstDivision
  • 1,340
  • 3
  • 17
  • 37

1 Answers1

2

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

Nate
  • 2,364
  • 1
  • 10
  • 16
  • 1
    This has been released in the latest version of the CLI: https://cli.github.com/manual/gh_release_create – FirstDivision Jan 05 '22 at 16:29
  • 1
    It's not, at the time of writing, on the [latest github ubuntu-latest runner though](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md) – FirstDivision Jan 05 '22 at 16:52
  • According to this [comment on actions/environments#4835](https://github.com/actions/virtual-environments/issues/4835#issuecomment-1006314860) It seems they should be releasing new builds next week with the new gh cli version. – bric3 Jan 07 '22 at 09:35