Question

Is there a way to automatically generate a change log from Github issues?

Ideally I want to be able to point at a closed milestone and generate either a plain text list of closed issues with their titles or, even better, a list with markup for links to the issues and the title of the issues themselves.

Was it helpful?

Solution

You can try to use Github-Changelog-Generator. (I'm author of this project)

It generates changelog from tags and merged pull-requests. This script also have a support of GitHub Issues.

This changelog was generated by this script. CHANGELOG.md

Example:

Changelog

1.2.5 (2015-01-15)

Full Changelog

Implemented enhancements:

  • Use milestone to specify in which version bug was fixed #22

Fixed bugs:

  • Error when trying to generate log for repo without tags #32

Merged pull requests:

  • PrettyPrint class is included using lowercase 'pp' #43 (schwing)

  • support enterprise github via command line options #42 (glenlovett)

OTHER TIPS

This isn't for Github specifically, but through Git you can run the log through pretty print to generate a changelog style html page.

From https://coderwall.com/p/5cv5lg

git log v2.1.0...v2.1.1 --pretty=format:'<li> <a href="http://github.com/jerel/<project>/commit/%H">view commit &bull;</a> %s</li> ' --reverse | grep "#changelog"

You can use the GitHub API to get a list of issues associated with a given milestone. For example:

curl https://api.github.com/repos/<user>/<project>/issues\?milestone\=1\&state\=closed

replace <user> and <project> with the username and project and this will return a json list of all closed issues of the milestone with the id 1. You can then, for example, use a script to extract the information you are interested. Here is a python example that prints the list of issues as restructured text:

import json

with open("issues.json") as of:
    data = json.load(of)

for issue in data:
    t = issue['title']
    n = issue['number']
    url = issue['html_url']
    print "* %s [`Issue %s <%s>`_]" % (t, n, url)

See if the following tool will do for you github-changes.

Disclosure: I'm the author of the tool.

We created an open source project to generate changelog from the list of closed github issues since a given datetime. It's available here: https://github.com/piwik/github-changelog-generator

Not directly through GitHub: that would be a kind of hook that you could put in place, and which would based on naming convention or comment convention that your project might follow.
Even using the issues title isn't always a sure way to generate meaningful change log, unless you review and edit if needed each and every issue title of your project.

In other words, it is very dependent on how you manage your project and not easily generalized to all GitHub repos.
I said as much in a very similar question "Publish a project release (binary/source packages) on Github?".

In addition of a third-party solution (or a GitHub Action like generate-changelog), you might soon Q3 2021, have a native feature from GitHub:

One of the most important parts of the software lifecycle is releasing your code for others to consume.

GitHub Releases will make that even easier by providing compelling and automatic release notes.
When creating a Release, you can click a button to automatically generate release notes.
If you want something more custom, you can a REST API to get the generated release notes and integrate them into your existing releases process.

We also want to ensure that these release notes look amazing when a maintainer shares them and make them easier to discover. We have done a complete redesign of releases to make projects announcements look stunning.

We are surfacing these releases in the feed to increase discovery.

We are also improving the open graph data for releases so they look equally fantastic when shared off of the GitHub platform.

Intended Outcome

Our number one goal is to make it easy for maintainers to create great release notes so more people can discover that amazing work maintainers are doing.

With minimal effort many projects will be able to benefit from detailed release notes.

For maintainers who put more time into their release notes to write editorialized content the intended outcome is that we free up time they are currently spending to maintain custom infrastructure and compile a changelog so they can focus on the most important content for their customers, high quality editorialized content.

Our other goal is to ensure that the release notes look great and are something maintainers and developers are excited to read and share.

How will it work?

  • The new Releases UI will be able to be enable with feature preview
  • A new button in the Release creation UI will be able to be pressed to generate release notes from any tag
  • The generated notes will be able to be configured via a .github/release.yml
  • A new REST API will allow customers to generate notes at their own convenience to further automate and customize the experience with GitHub actions.

I helped build a jQuery plugin for this recently that uses GitHub issues to communicate app updates directly to the user. The repo can be found here https://github.com/uberVU/github-changelog

Usage is pretty simple:

$(function() {
  var $demoChangelog = $('.demo-changelog');

  //call the plugin on a dom none
  $demoChangelog.changelog({
    //give it a repo to monitor
    githubRepo: 'uberVU/github-changelog-playground',
  });

  //manually check for new closed issues
  $('.demo-button').on('click', function(e) {
    e.stopPropagation();
    $demoChangelog.changelog('checkForUpdates');
  });
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top