12

Is there any way to automatically generate change logs from commit messages to a file called CHANGELOG.md in a GitHub repo?

Might be possible using a service hook on a repo?

keto23
  • 1,177
  • 1
  • 10
  • 16

3 Answers3

8

I have written something like this some months ago. It is based on Git's porcelain and uses a git hook in plain bash.

You can find it in my Github Repo.

Martin Seeler
  • 6,874
  • 3
  • 33
  • 45
3

Since the May 2013 File CRUD API with this API, it should be possible to script it by:

  • parsing the git log message
  • using the result to update the CHANGELOG.md file

See Update file:

PUT /repos/:owner/:repo/contents/:path

You actually can trigger that script from a GitHub post-receive hook, except that hook won't execute it directly, but POST a JSON message to a server of yours, which, on the reception of that specific message, will know how to update the GitHub CHANGELOG.md file (through API call mentioned above).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • You will need to make sure not to create an infinite loop this way, though (Push -> Hook gets activated -> Changelog is updated and pushed -> rinse and repeat). Not impossible, but something one should keep in mind. – Polygnome May 18 '13 at 13:49
  • @Polygnome the JSON contains all the information you need to help you differentiate between the two pushes, making sure you won't do anything on the second one. – VonC May 18 '13 at 14:18
1

I have created a GitHub app 'Changelogg.io' to automate changelog from merged pull requests.

It detects changes mentioned in the PRs and creates a release draft for it. After adding the release version, it automatically updates CHANGELOG.md and also has a web UI with filters for the generated changelog. Few other features:

  • Insights generated from changes (Stats like bugs to feature ratio, Trend over time for repository)
  • Slack Integration for each repository

Youtube Walkthrough

mukul
  • 55
  • 1
  • 9