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

Autogenerate release messages #26

Open
kjagiello opened this issue Oct 5, 2021 · 1 comment
Open

Autogenerate release messages #26

kjagiello opened this issue Oct 5, 2021 · 1 comment

Comments

@kjagiello
Copy link

kjagiello commented Oct 5, 2021

GitHub just released a public beta of a feature that allows us to automatically generate release notes based on a commit range. Once it goes fully public, it would be neat to support it.

Release post: https://github.blog/2021-10-04-beta-github-releases-improving-release-experience/#introducing-auto-generated-release-notes
Relevant API docs: https://docs.github.com/en/rest/reference/repos#generate-release-notes-content-for-a-release

@kjagiello kjagiello changed the title Autogenerate release message Autogenerate release messages Oct 5, 2021
@kjagiello
Copy link
Author

kjagiello commented Oct 29, 2021

Sample usage of the new endpoint:

#!/usr/bin/env bash

REPO="user/repo"
TARGET_RELEASE=$1
PREVIOUS_RELEASE=$(gh api /repos/${REPO}/releases | jq -r .[0].name)
TARGET_COMMITISH=$(gh api repos/${REPO} | jq -r .default_branch)

gh api \
  /repos/${REPO}/releases/generate-notes \
  -f target_commitish=${TARGET_COMMITISH} \
  -f previous_tag_name=releases/${PREVIOUS_RELEASE} \
  -f tag_name=releases/${TARGET_RELEASE} \
  | jq -r .body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant