github_changelog_generator 1.15.0.pre.alpha → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +1 -1
  3. data/README.md +332 -275
  4. data/Rakefile +3 -4
  5. data/bin/git-generate-changelog +1 -1
  6. data/lib/github_changelog_generator.rb +10 -6
  7. data/lib/github_changelog_generator/generator/entry.rb +218 -0
  8. data/lib/github_changelog_generator/generator/generator.rb +126 -104
  9. data/lib/github_changelog_generator/generator/generator_fetcher.rb +139 -23
  10. data/lib/github_changelog_generator/generator/generator_processor.rb +59 -27
  11. data/lib/github_changelog_generator/generator/generator_tags.rb +26 -22
  12. data/lib/github_changelog_generator/generator/section.rb +124 -0
  13. data/lib/github_changelog_generator/helper.rb +1 -1
  14. data/lib/github_changelog_generator/octo_fetcher.rb +261 -130
  15. data/lib/github_changelog_generator/options.rb +74 -1
  16. data/lib/github_changelog_generator/parser.rb +120 -176
  17. data/lib/github_changelog_generator/parser_file.rb +8 -3
  18. data/lib/github_changelog_generator/reader.rb +2 -2
  19. data/lib/github_changelog_generator/task.rb +5 -6
  20. data/lib/github_changelog_generator/version.rb +1 -1
  21. data/man/git-generate-changelog.1 +144 -45
  22. data/man/git-generate-changelog.1.html +157 -84
  23. data/man/git-generate-changelog.html +19 -7
  24. data/man/git-generate-changelog.md +151 -84
  25. data/spec/files/github-changelog-generator.md +114 -114
  26. data/spec/{install-gem-in-bundler.gemfile → install_gem_in_bundler.gemfile} +2 -0
  27. data/spec/spec_helper.rb +2 -6
  28. data/spec/unit/generator/entry_spec.rb +766 -0
  29. data/spec/unit/generator/generator_processor_spec.rb +103 -41
  30. data/spec/unit/generator/generator_spec.rb +47 -0
  31. data/spec/unit/generator/generator_tags_spec.rb +56 -24
  32. data/spec/unit/generator/section_spec.rb +34 -0
  33. data/spec/unit/octo_fetcher_spec.rb +247 -197
  34. data/spec/unit/options_spec.rb +28 -4
  35. data/spec/unit/parse_file_spec.rb +2 -2
  36. data/spec/unit/parser_spec.rb +0 -79
  37. data/spec/unit/reader_spec.rb +4 -4
  38. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_commits/when_API_is_valid/returns_commits.json +1 -0
  39. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_commits_before/when_API_is_valid/returns_commits.json +1 -1
  40. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid.json +1 -1
  41. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issue_with_proper_key/values.json +1 -1
  42. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issues.json +1 -1
  43. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issues_with_labels.json +1 -1
  44. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_pull_request_with_proper_key/values.json +1 -1
  45. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_pull_requests_with_labels.json +1 -1
  46. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid.json +1 -1
  47. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid/returns_correct_pull_request_keys.json +1 -1
  48. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid/returns_pull_requests.json +1 -1
  49. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_commit/when_API_call_is_valid.json +1 -1
  50. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_commit/when_API_call_is_valid/returns_commit.json +1 -1
  51. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_date_of_tag/when_API_call_is_valid.json +1 -1
  52. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_date_of_tag/when_API_call_is_valid/returns_date.json +1 -1
  53. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_events_async/when_API_call_is_valid.json +1 -1
  54. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_events_async/when_API_call_is_valid/populates_issues.json +1 -1
  55. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid.json +1 -1
  56. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid/should_return_tags.json +1 -1
  57. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid/should_return_tags_count.json +1 -1
  58. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_wrong_token_provided.json +1 -1
  59. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_wrong_token_provided/should_raise_Unauthorized_error.json +1 -1
  60. metadata +71 -38
  61. data/bin/ghclgen +0 -5
  62. data/lib/github_changelog_generator/generator/generator_generation.rb +0 -180
  63. data/spec/unit/generator/generator_generation_spec.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 90e44c8d99a9213765a5d46605dd584956f79ca0
4
- data.tar.gz: e42720ae60fc9c8096c41cb51456e0aacdcc8b69
2
+ SHA256:
3
+ metadata.gz: cb493bfacf7e5ec521d56e8ac70078b9f2297e88707aaa1adc267fa1f2caa829
4
+ data.tar.gz: b5368080a19d7b90f36087b1601cffed3034b4e0562e0c57b9bbe519a683cdee
5
5
  SHA512:
6
- metadata.gz: fafd2adab89a40c20fc1975da3a569f7a559c377d564c8b79268d6630472daf54f00ed52389c3fc351c93f645106305454943bdbdde740d51b23eb508dec57fb
7
- data.tar.gz: 6143d6c610624b8ac836292698d01e6adb941c2fa21399ab85e7831982587d7b329a802c7fba0c51b986b85b58860850b1c2cb9034ffac7bdcc2329c0f0f01f6
6
+ metadata.gz: a5482719348a05eec6f1644a9ff8298720e1b33dc34bb7d8ee030e567878285e0b538d17039f8cc23aac5829a9eddeaf96f3d7e5d68b44d3e1ec848c2cbbcffc
7
+ data.tar.gz: e172b08ad77a2c4d6650441a36bd594dcbc186ab85afc47c382d1ea303927fbed3aae280987e25e264eb92419b75ae3262466a92950653a21b8e1093b120e3dd
data/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
1
  The MIT License (MIT)
2
- Copyright (c) 2016 Petr Korolev
2
+ Copyright (c) 2016-2019 Petr Korolev
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
5
 
data/README.md CHANGED
@@ -1,275 +1,332 @@
1
- [![Gem Version](https://badge.fury.io/rb/github_changelog_generator.svg)](http://badge.fury.io/rb/github_changelog_generator)
2
- [![Dependency Status](https://gemnasium.com/skywinder/github-changelog-generator.svg)](https://gemnasium.com/skywinder/github-changelog-generator)
3
- [![Build Status](https://travis-ci.org/skywinder/github-changelog-generator.svg?branch=master)](https://travis-ci.org/skywinder/github-changelog-generator)
4
- [![Build status](https://ci.appveyor.com/api/projects/status/xdfnfmdjfo0upm7m?svg=true)](https://ci.appveyor.com/project/olleolleolle/github-changelog-generator)
5
- [![Inline docs](http://inch-ci.org/github/skywinder/github-changelog-generator.svg)](http://inch-ci.org/github/skywinder/github-changelog-generator)
6
- [![Code Climate](https://codeclimate.com/github/skywinder/github-changelog-generator/badges/gpa.svg)](https://codeclimate.com/github/skywinder/github-changelog-generator)
7
- [![Test Coverage](https://codeclimate.com/github/skywinder/github-changelog-generator/badges/coverage.svg)](https://codeclimate.com/github/skywinder/github-changelog-generator)
8
- [![Join the chat at https://gitter.im/github-changelog-generator/chat](https://badges.gitter.im/github-changelog-generator/chat.svg)](https://gitter.im/github-changelog-generator/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9
-
10
- GitHub Changelog Generator ![GitHub Logo](../master/images/logo.jpg)
11
- ==================
12
-
13
- - [Installation](#installation)
14
- - [Output example](#output-example)
15
- - [Usage](#usage)
16
- - [Params](#params)
17
- - [GitHub token](#github-token)
18
- - [Features and advantages of this project](#features-and-advantages-of-this-project)
19
- - [Alternatives](#alternatives)
20
- - [Projects using this library](#projects-using-this-library)
21
- - [Am I missing some essential feature?](#am-i-missing-some-essential-feature)
22
- - [Contributing](#contributing)
23
- - [License](#license)
24
-
25
-
26
- ### Changelog generation has never been so easy
27
-
28
- **Fully automated changelog generation** - This gem generates a change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according to labels) from :octocat: GitHub Issue Tracker.
29
-
30
- Since you don't have to fill your `CHANGELOG.md` manually now: just run the script, relax and take a cup of :coffee: before your next release! :tada:
31
-
32
- ### *What’s the point of a change log?*
33
- To make it easier for users and contributors to see precisely what notable changes have been made between each release (or version) of the project.
34
- ### *Why should I care?*
35
- Because software tools are for people. If you don’t care, why are you contributing to open source? Surely, there must be a kernel (ha!) of care somewhere in that lovely little brain of yours.
36
-
37
- :arrow_right: *[http://keepachangelog.com](http://keepachangelog.com)*
38
-
39
- ## Installation
40
-
41
- gem install github_changelog_generator
42
-
43
- See also Troubleshooting.
44
-
45
- ## Output example
46
-
47
- - Look at **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project
48
- - [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command:
49
-
50
- github_changelog_generator -u skywinder -p ActionSheetPicker-3.0
51
-
52
- - In general, it looks like this:
53
-
54
- > ## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
55
- >
56
- > [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
57
- >
58
- > **Implemented enhancements:**
59
- >
60
- > - Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
61
- >
62
- > **Fixed bugs:**
63
- >
64
- > - Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
65
- >
66
- > **Merged pull requests:**
67
- >
68
- > - PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
69
- >
70
- > - support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
71
-
72
-
73
- ## Usage
74
- **It's really simple!**
75
-
76
- - If your **`git remote`** `origin` refers to your GitHub repo, just go to your project folder and run:
77
-
78
- github_changelog_generator
79
-
80
- - Or, run this from anywhere:
81
- `github_changelog_generator -u github_username -p github_project`
82
- `github_changelog_generator github_username/github_project`
83
-
84
- - If you are running it against a repository on a Github Enterprise install, you must specify *both* `--github-site` and `--github-api` command line options:
85
-
86
- github_changelog_generator --github-site="https://github.yoursite.com" \
87
- --github-api="https://github.yoursite.com/api/v3/"
88
-
89
- This generates a changelog to the `CHANGELOG.md` file, with pretty markdown formatting.
90
-
91
- ### Params
92
- Type `github_changelog_generator --help` for details.
93
-
94
- For more details about params, read the Wiki page: [**Advanced change log generation examples**](https://github.com/skywinder/github-changelog-generator/wiki/Advanced-change-log-generation-examples)
95
-
96
- ### Params File
97
- In your project root, you can put a params file named `.github_changelog_generator` to override default params:
98
-
99
- Example:
100
- ```
101
- unreleased=false
102
- future-release=5.0.0
103
- since-tag=1.0.0
104
- ```
105
-
106
- ### GitHub token
107
-
108
- GitHub only allows 50 unauthenticated requests per hour.
109
- Therefore, it's recommended to run this script with authentication by using a **token**.
110
-
111
- Here's how:
112
-
113
- - [Generate a token here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token) - you only need "repo" scope for private repositories
114
- - Either:
115
- - Run the script with `--token <your-40-digit-token>`; **OR**
116
- - Set the `CHANGELOG_GITHUB_TOKEN` environment variable to your 40 digit token
117
-
118
- You can set an environment variable by running the following command at the prompt, or by adding it to your shell profile (e.g., `~/.bash_profile` or `~/.zshrc`):
119
-
120
- export CHANGELOG_GITHUB_TOKEN="«your-40-digit-github-token»"
121
-
122
- So, if you get a message like this:
123
-
124
- ``` markdown
125
- API rate limit exceeded for github_username.
126
- See: https://developer.github.com/v3/#rate-limiting
127
- ```
128
-
129
- It's time to create this token! (Or, wait an hour for GitHub to reset your unauthenticated request limit.)
130
-
131
- ## Migrating from a manual changelog
132
-
133
- Knowing how dedicated you are to your project, you probably haven't been waiting for `github-changelog-generator` to keep a changelog.
134
- But you probably don't want your project's open issues and PRs for all past features listed in your historic changelog, either.
135
-
136
- That's where `--base <your-manual-changelog.md>` comes in handy!
137
- This option lets append your old manual changelog to the end of the generated entries.
138
-
139
- If you have a `HISTORY.md` file in your project, it will automatically be picked as the static historical changelog and appended.
140
-
141
- ### Rake task
142
-
143
- You love `rake`? We do, too! So, we've made it even easier for you:
144
- we've provided a `rake` task library for your changelog generation.
145
-
146
- Just put something like this in your `Rakefile`:
147
-
148
- ```ruby
149
- require 'github_changelog_generator/task'
150
-
151
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
152
- config.since_tag = '0.1.14'
153
- config.future_release = '0.2.0'
154
- end
155
- ```
156
-
157
- All command line options can be passed to the `rake` task as `config` parameters. And since you're naming the `rake` task yourself, you can create as many as you want.
158
-
159
- You can look for params names from the [parser source code (#setup_parser)](https://github.com/skywinder/github-changelog-generator/blob/master/lib/github_changelog_generator/parser.rb). For example, to translate the bugs label to Portuguese, instead of setting `config.bugs_label`, you have to set `config.bug_prefix`, and so on.
160
-
161
- ## Features and advantages of this project
162
- - Generate canonical, neat change log file, followed by [basic change log guidelines](http://keepachangelog.com) :gem:
163
- - Optionally generate **Unreleased** changes (closed issues that have not released yet) :dizzy:
164
- - **GitHub Enterprise support** via command line options! :factory:
165
- - Flexible format **customization**:
166
- - **Customize** issues that **should be added** to changelog :eight_spoked_asterisk:
167
- - **Custom date formats** supported (but keep [ISO 8601](http://xkcd.com/1179/) in mind!) :date:
168
- - Manually specify the version that fixed an issue (for cases when the issue's Closed date doesn't match) by giving the issue's `milestone` the same name as the tag of version :pushpin:
169
- - Automatically **exclude specific issues** that are irrelevant to your changelog (by default, any issue labeled `question`, `duplicate`, `invalid`, or `wontfix`) :scissors:
170
- - **Distinguish** issues **by labels**. :mag_right:
171
- - Merged pull requests (all merged pull-requests) :twisted_rightwards_arrows:
172
- - Bug fixes (issues labeled `bug`) :beetle:
173
- - Enhancements (issues labeled `enhancement`) :star2:
174
- - Issues (closed issues with no labels) :non-potable_water:
175
-
176
- - Manually include or exclude issues by labels :wrench:
177
- - Customize lots more! Tweak the changelog to fit your preferences :tophat:
178
- (*See `github_changelog_generator --help` for details)*
179
-
180
-
181
- ### Alternatives
182
- Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives) that I found. But none satisfied my requirements.
183
-
184
- *If you know other projects, feel free to edit this Wiki page!*
185
-
186
-
187
- ### Projects using this library
188
- Here's a [wikipage list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator).
189
-
190
- If you've used this project in a live app, please let me know! Nothing makes me happier than seeing someone else take my work and go wild with it.
191
-
192
- *If you are using `github_changelog_generator` to generate your project's changelog, or know of other projects using it, please [add it to this list] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator).*
193
-
194
- ## Am I missing some essential feature?
195
-
196
- - **Nothing is impossible!**
197
-
198
- - Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make the generator better together!
199
-
200
- - *Bug reports, feature requests, patches, and well-wishes are always welcome.* :heavy_exclamation_mark:
201
-
202
- ## FAQ
203
-
204
- - ***I already use GitHub Releases. Why do I need this?***
205
-
206
- GitHub Releases is a very good thing. And it's very good practice to maintain it. (Not a lot of people are using it yet!) :congratulations:
207
-
208
- *BTW: I would like to support GitHub Releases in [next releases](https://github.com/skywinder/github-changelog-generator/issues/56) ;)*
209
-
210
- I'm not trying to compare the quality of handwritten and auto-generated logs. That said....
211
-
212
- An auto-generated changelog really helps, even if you manually fill in the release notes!
213
-
214
- For example:
215
-
216
- When you find a closed bug, it is very useful to know which release fixed it.
217
- So that you can easily find the issue by \# in `CHANGELOG.md`.
218
-
219
- - it's not quite as easy to find this in handwritten releases notes
220
- - a generated file saves you the trouble of remembering everything;
221
- sometimes people forget to add things to a handwritten file
222
-
223
- Ultimately, I think GitHub Releases are ideal for end-users.
224
- Meanwhile, `CHANGELOG.md` lives right in the repository, with its detailed list of changes, which is handy for developers.
225
- Finally, there's nothing wrong with using GitHub Releases alongside `CHANGELOG.md` in this combination.
226
-
227
- - ***I received a warning: "GitHub API rate limit exceed" What does this mean?***
228
-
229
- GitHub [limits the number of API requests](https://developer.github.com/v3/#rate-limiting) you can make in an hour. You can make up to 5,000 requests per hour. For unauthenticated requests, the rate limit is only up to 60 requests per hour. Unauthenticated requests are associated with your IP address (not the user making requests).
230
-
231
- If you're seeing this warning, please do the following:
232
-
233
- 1. Make sure you're providing an OAuth token, so you're not making requests anonymously. Using an OAuth token increases your hourly request maximum from 60 to 5000.
234
- 2. If you have a large repo with lots of issues/PRs, you can use `--max-issues NUM` to limit the number of issues that are pulled back. For example: `--max-issues 1000`
235
-
236
- - ***My Ruby version is very old, can I use this?***
237
-
238
- When your Ruby is old, and you don't want to upgrade, and you want to
239
- control which libraries you use, you can use Bundler.
240
-
241
- In a Gemfile, perhaps in a non-deployed `:development` group, add this
242
- gem:
243
-
244
- ```ruby
245
- group :development do
246
- gem 'github_changelog_generator', require: false
247
- end
248
- ```
249
-
250
- Then you can keep back dependencies like rack, which currently is only
251
- compatible with Ruby >= 2.2.2. So, use an older version for your app by
252
- adding a line like this to the Gemfile:
253
-
254
- ```
255
- gem 'rack', '~> 1.6'
256
- ```
257
-
258
- This way, you can keep on using github_changelog_generator, even if you
259
- can't get the latest version of Ruby installed.
260
-
261
- ## Contributing
262
-
263
- 1. Create an issue and describe your idea
264
- 2. [Fork it](https://github.com/skywinder/github-changelog-generator/fork)
265
- 3. Create your feature branch (`git checkout -b my-new-feature`)
266
- 4. Commit your changes (`git commit -am 'Add some feature'`)
267
- 5. Publish the branch (`git push origin my-new-feature`)
268
- 6. Create a new Pull Request
269
- 7. Profit! :white_check_mark:
270
-
271
- You can test your workflow with changelog generator with [the skywinder/changelog_test repo](https://github.com/skywinder/changelog_test/).
272
-
273
- ## License
274
-
275
- Github Changelog Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).
1
+ [![Gem Version](https://badge.fury.io/rb/github_changelog_generator.svg)](http://badge.fury.io/rb/github_changelog_generator)
2
+ [![CircleCI](https://circleci.com/gh/github-changelog-generator/github-changelog-generator.svg?style=svg)](https://circleci.com/gh/github-changelog-generator/github-changelog-generator)
3
+ [![Inline docs](http://inch-ci.org/github/github-changelog-generator/github-changelog-generator.svg)](http://inch-ci.org/github/github-changelog-generator/github-changelog-generator)
4
+ [![Join the chat at https://gitter.im/github-changelog-generator/chat](https://badges.gitter.im/github-changelog-generator/chat.svg)](https://gitter.im/github-changelog-generator/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
+
6
+ # github-changelog-generator ![GitHub Logo](../master/images/logo.jpg)
7
+
8
+ <!--
9
+ To update TOC, please run:
10
+ > doctoc ./README.md --github
11
+ -->
12
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
13
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
14
+
15
+
16
+ - [Changelog generation has never been so easy](#changelog-generation-has-never-been-so-easy)
17
+ - [*What’s the point of a changelog?*](#whats-the-point-of-a-changelog)
18
+ - [*Why should I care?*](#why-should-i-care)
19
+ - [Installation](#installation)
20
+ - [Running with Docker](#running-with-docker)
21
+ - [Output example](#output-example)
22
+ - [Usage](#usage)
23
+ - [Params](#params)
24
+ - [Params File](#params-file)
25
+ - [GitHub token](#github-token)
26
+ - [Migrating from a manual changelog](#migrating-from-a-manual-changelog)
27
+ - [Rake task](#rake-task)
28
+ - [Features and advantages of this project](#features-and-advantages-of-this-project)
29
+ - [Using the summary section feature](#using-the-summary-section-feature)
30
+ - [Alternatives](#alternatives)
31
+ - [Projects using this library](#projects-using-this-library)
32
+ - [Am I missing some essential feature?](#am-i-missing-some-essential-feature)
33
+ - [FAQ](#faq)
34
+ - [Contributing](#contributing)
35
+ - [License](#license)
36
+
37
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
38
+
39
+
40
+ ### Changelog generation has never been so easy
41
+
42
+ **Fully automated changelog generation** - This gem generates a changelog file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according to labels) from :octocat: GitHub Issue Tracker.
43
+
44
+ Since you don't have to fill your `CHANGELOG.md` manually now: just run the script, relax and take a cup of :coffee: before your next release! :tada:
45
+
46
+ ### *What’s the point of a changelog?*
47
+
48
+ To make it easier for users and contributors to see precisely what notable changes have been made between each release (or version) of the project.
49
+
50
+ ### *Why should I care?*
51
+
52
+ Because software tools are for _people_. "Changelogs make it easier for users and
53
+ contributors to see precisely what notable changes have been made between each
54
+ release (or version) of the project."
55
+
56
+ :arrow_right: *[https://keepachangelog.com](https://keepachangelog.com)*
57
+
58
+ ## Installation
59
+
60
+ GitHub Changelog Generator is a [Ruby](https://www.ruby-lang.org/)
61
+ program, distributed as a RubyGem. The Ruby language homepage has an [Installation page](https://www.ruby-lang.org/en/documentation/installation/).
62
+
63
+ Install the gem like:
64
+
65
+ $ gem install github_changelog_generator
66
+
67
+ Depending on your system, you _may_ need to run the shell as an Administrator (Windows),
68
+ or use `sudo gem install github_changelog_generator` (Linux).
69
+
70
+
71
+ ## Usage
72
+
73
+
74
+ ### Running with CLI:
75
+
76
+ github_changelog_generator -u github_project_namespace -p github_project
77
+
78
+ (where the project namespace is _likely_ your username if it's a project you own, but it could also be the namespace of the project)
79
+
80
+
81
+ ### Running with Docker
82
+
83
+ Using [Docker](https://www.docker.com/products/docker-desktop) is an alternative to installing Ruby and the gem.
84
+
85
+ Example invocation:
86
+
87
+ $ docker run -it --rm -v "$(pwd)":/usr/local/src/your-app ferrarimarco/github-changelog-generator
88
+
89
+
90
+
91
+ - For Github Enterprise repos, specify *both* `--github-site` and `--github-api` options:
92
+
93
+ $ github_changelog_generator --github-site="https://github.yoursite.com" \
94
+ --github-api="https://github.yoursite.com/api/v3/"
95
+
96
+
97
+ This generates a `CHANGELOG.md`, with pretty Markdown formatting.
98
+
99
+
100
+ ## Output example
101
+
102
+ - Look at **[CHANGELOG.md](https://github.com/github-changelog-generator/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project
103
+ - [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/develop/CHANGELOG.md) was generated by command:
104
+
105
+ $ github_changelog_generator -u github-changelog-generator -p ActionSheetPicker-3.0
106
+
107
+ - In general, it looks like this:
108
+
109
+ > ## [1.2.5](https://github.com/github-changelog-generator/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
110
+ >
111
+ > [Full Changelog](https://github.com/github-changelog-generator/Github-Changelog-Generator/compare/1.2.4...1.2.5)
112
+ >
113
+ > **Implemented enhancements:**
114
+ >
115
+ > - Use milestone to specify in which version bug was fixed [\#22](https://github.com/github-changelog-generator/Github-Changelog-Generator/issues/22)
116
+ >
117
+ > **Fixed bugs:**
118
+ >
119
+ > - Error when trying to generate log for repo without tags [\#32](https://github.com/github-changelog-generator/Github-Changelog-Generator/issues/32)
120
+ >
121
+ > **Merged pull requests:**
122
+ >
123
+ > - PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/github-changelog-generator/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
124
+ >
125
+ > - support enterprise github via command line options [\#42](https://github.com/github-changelog-generator/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
126
+
127
+ ### Params
128
+
129
+ Print help for all command-line options to learn more details:
130
+
131
+ $ github_changelog_generator --help
132
+
133
+ For more details about params, read the Wiki page: [**Advanced changelog generation examples**](https://github.com/github-changelog-generator/github-changelog-generator/wiki/Advanced-change-log-generation-examples)
134
+
135
+ ### Params File
136
+
137
+ In your project root, you can put a params file named `.github_changelog_generator` to override default params:
138
+
139
+ Example:
140
+
141
+ ```
142
+ unreleased=false
143
+ future-release=5.0.0
144
+ since-tag=1.0.0
145
+ ```
146
+
147
+ ### GitHub token
148
+
149
+ GitHub only allows **50 unauthenticated requests per hour**.
150
+
151
+ Therefore, it's recommended to run this script with authentication by using a **token**.
152
+
153
+ Here's how:
154
+
155
+ - [Generate a token here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token) - you only need "repo" scope for private repositories
156
+ - Either:
157
+ - Run the script with `--token <your-40-digit-token>`; **OR**
158
+ - Set the `CHANGELOG_GITHUB_TOKEN` environment variable to your 40 digit token
159
+
160
+ You can set an environment variable by running the following command at the prompt, or by adding it to your shell profile (e.g., `.env`, `~/.bash_profile`, `~/.zshrc`, etc):
161
+
162
+ export CHANGELOG_GITHUB_TOKEN="«your-40-digit-github-token»"
163
+
164
+ So, if you get a message like this:
165
+
166
+ ``` markdown
167
+ API rate limit exceeded for github_username.
168
+ See: https://developer.github.com/v3/#rate-limiting
169
+ ```
170
+
171
+ It's time to create this token! (Or, wait an hour for GitHub to reset your unauthenticated request limit.)
172
+
173
+ ## Migrating from a manual changelog
174
+
175
+ Knowing how dedicated you are to your project, you probably haven't been waiting for `github-changelog-generator` to keep a changelog.
176
+ But you probably don't want your project's open issues and PRs for all past features listed in your historic changelog, either.
177
+
178
+ That's where `--base <your-manual-changelog.md>` comes in handy!
179
+ This option lets append your old manual changelog to the end of the generated entries.
180
+
181
+ If you have a `HISTORY.md` file in your project, it will automatically be picked as the static historical changelog and appended.
182
+
183
+ ### Rake task
184
+
185
+ You love `rake`? We do, too! So, we've made it even easier for you:
186
+ we've provided a `rake` task library for your changelog generation.
187
+
188
+ Configure the task in your `Rakefile`:
189
+
190
+ ```ruby
191
+ require 'github_changelog_generator/task'
192
+
193
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
194
+ config.user = 'username'
195
+ config.project = 'project-name'
196
+ config.since_tag = '0.1.14'
197
+ config.future_release = '0.2.0'
198
+ end
199
+ ```
200
+
201
+ All command-line options can be passed to the `rake` task as `config`
202
+ parameters. And since you're naming the `rake` task yourself, you can create
203
+ as many as you want.
204
+
205
+ You can look for params names from the [parser source code (#setup_parser)](https://github.com/github-changelog-generator/github-changelog-generator/blob/master/lib/github_changelog_generator/parser.rb). For example, to translate the bugs label to Portuguese, instead of setting `config.bugs_label`, you have to set `config.bug_prefix`, and so on.
206
+
207
+ ## Features and advantages of this project
208
+
209
+ - Generate canonical, neat changelog file, with default sections that follow [basic changelog guidelines](http://keepachangelog.com) :gem:
210
+ - Optionally generate **Unreleased** changes (closed issues that have not released yet) :dizzy:
211
+ - **GitHub Enterprise support** via command line options! :factory:
212
+ - Flexible format **customization**:
213
+ - **Customize** issues that **should be added** to changelog :eight_spoked_asterisk:
214
+ - **Custom date formats** supported (but keep [ISO 8601](http://xkcd.com/1179/) in mind!) :date:
215
+ - Manually specify the version that fixed an issue (for cases when the issue's Closed date doesn't match) by giving the issue's `milestone` the same name as the tag of version :pushpin:
216
+ - Automatically **exclude specific issues** that are irrelevant to your changelog (by default, any issue labeled `question`, `duplicate`, `invalid`, or `wontfix`) :scissors:
217
+ - **Distinguish** issues **by labels**. :mag_right:
218
+ - Merged pull requests (all merged pull-requests) :twisted_rightwards_arrows:
219
+ - Bug fixes (issues labeled `bug`) :beetle:
220
+ - Enhancements (issues labeled `enhancement`) :star2:
221
+ - Issues (closed issues with no labels) :non-potable_water:
222
+
223
+ - Manually include or exclude issues by labels :wrench:
224
+ - Customize lots more! Tweak the changelog to fit your preferences :tophat:
225
+ (*See `github_changelog_generator --help` for details)*
226
+
227
+ ### Using the summary section feature
228
+
229
+ For each version, you can add a _release summary_ with text, images, gif animations,
230
+ etc, and show new features and notes clearly to the user. This is done using GitHub metadata.
231
+
232
+ **Example**: adding the release summary for v1.0.0:
233
+
234
+ 1. Create a new GitHub Issue
235
+ 2. In the Issue's _Description_ field, add your release summary content
236
+ ```
237
+ ![image](https://user-images.githubusercontent.com/12690315/45935880-006a8200-bfeb-11e8-958e-ff742ae66b96.png)
238
+
239
+ Hello, World! :tada:
240
+ ```
241
+ 3. Set the Issue Label `release-summary` and add it to the GitHub Milestone `v1.0.0`
242
+ 4. Close the Issue and execute `github-changelog-generator`
243
+ 5. The result looks like this:
244
+ > ## [v1.0.0](https://github.com/github-changelog-generator/github-changelog-generator/tree/1.0.0) (2014-11-07)
245
+ > [Full Changelog](https://github.com/github-changelog-generator/github-changelog-generator/compare/0.1.0...1.0.0)
246
+ >
247
+ > ![image](https://user-images.githubusercontent.com/12690315/45935880-006a8200-bfeb-11e8-958e-ff742ae66b96.png)
248
+ >
249
+ > Hello, World! :tada:
250
+ >
251
+ > **Implemented enhancements:**
252
+ > - Add some features
253
+
254
+ ### Alternatives
255
+
256
+ Here is a [wikipage list of alternatives](https://github.com/github-changelog-generator/Github-Changelog-Generator/wiki/Alternatives) that I found. But none satisfied my requirements.
257
+
258
+ *If you know other projects, feel free to edit this Wiki page!*
259
+
260
+
261
+ ### Projects using this library
262
+
263
+ Here's a [wikipage list of projects](https://github.com/github-changelog-generator/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator).
264
+
265
+ If you've used this project in a live app, please let me know! Nothing makes me happier than seeing someone else take my work and go wild with it.
266
+
267
+ *If you are using `github_changelog_generator` to generate your project's changelog, or know of other projects using it, please [add it to this list](https://github.com/github-changelog-generator/github-changelog-generator/wiki/Projects-using-Github-Changelog-Generator).*
268
+
269
+ ## Am I missing some essential feature?
270
+
271
+ - **Nothing is impossible!**
272
+
273
+ - Open an [issue](https://github.com/github-changelog-generator/Github-Changelog-Generator/issues/new) and let's make the generator better together!
274
+
275
+ - *Bug reports, feature requests, patches, and well-wishes are always welcome.* :heavy_exclamation_mark:
276
+
277
+ ## FAQ
278
+
279
+ - ***I already use GitHub Releases. Why do I need this?***
280
+
281
+ GitHub Releases is a very good thing. And it's very good practice to maintain it. (Not a lot of people are using it yet!) :congratulations:
282
+
283
+ *BTW: I would like to support GitHub Releases in [next releases](https://github.com/github-changelog-generator/github-changelog-generator/issues/56) ;)*
284
+
285
+ I'm not trying to compare the quality of handwritten and auto-generated logs. That said....
286
+
287
+ An auto-generated changelog really helps, even if you manually fill in the release notes!
288
+
289
+
290
+ - ***My Ruby version is very old, can I use this?***
291
+
292
+ When your Ruby is old, and you don't want to upgrade, and you want to
293
+ control which libraries you use, you can use Bundler.
294
+
295
+ In a Gemfile, perhaps in a non-deployed `:development` group, add this
296
+ gem:
297
+
298
+ ```ruby
299
+ group :development do
300
+ gem 'github_changelog_generator', require: false
301
+ end
302
+ ```
303
+
304
+ Then you can keep back dependencies like rack, which currently is only
305
+ compatible with Ruby >= 2.2.2. So, use an older version for your app by
306
+ adding a line like this to the Gemfile:
307
+
308
+ ```
309
+ gem 'rack', '~> 1.6'
310
+ ```
311
+
312
+ This way, you can keep on using github_changelog_generator, even if you
313
+ can't get the latest version of Ruby installed.
314
+
315
+ - ***Windows: 1.14.x wants to create a file on an invalid path. Why?***
316
+
317
+ Windows: [v1.14.0 introduced a bug where it attempts to create /tmp/github_changelog-logger.log... which isn't a valid path on Windows and thus fails](https://github.com/github-changelog-generator/github-changelog-generator/issues/458)
318
+
319
+ Workaround: Create a `C:\tmp`.
320
+
321
+ ## Contributing
322
+
323
+ We have collected notes on how to contribute to this project in [CONTRIBUTING.md].
324
+
325
+ [CONTRIBUTING.md]: CONTRIBUTING.md
326
+
327
+ ## Contact us
328
+ [Join the chat at gitter : github-changelog-generator](https://gitter.im/github-changelog-generator/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
329
+
330
+ ## License
331
+
332
+ Github Changelog Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).