github_changelog_generator 1.15.0.pre.beta → 1.16.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +1 -1
  3. data/README.md +332 -285
  4. data/Rakefile +1 -1
  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 +124 -125
  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 +25 -21
  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 +233 -96
  15. data/lib/github_changelog_generator/options.rb +74 -2
  16. data/lib/github_changelog_generator/parser.rb +118 -74
  17. data/lib/github_changelog_generator/parser_file.rb +7 -3
  18. data/lib/github_changelog_generator/reader.rb +2 -2
  19. data/lib/github_changelog_generator/task.rb +4 -3
  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 +51 -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 +24 -0
  35. data/spec/unit/parse_file_spec.rb +2 -2
  36. data/spec/unit/reader_spec.rb +4 -4
  37. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_commits/when_API_is_valid/returns_commits.json +1 -0
  38. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_commits_before/when_API_is_valid/returns_commits.json +1 -1
  39. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid.json +1 -1
  40. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issue_with_proper_key/values.json +1 -1
  41. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issues.json +1 -1
  42. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issues_with_labels.json +1 -1
  43. 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
  44. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_pull_requests_with_labels.json +1 -1
  45. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid.json +1 -1
  46. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid/returns_correct_pull_request_keys.json +1 -1
  47. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid/returns_pull_requests.json +1 -1
  48. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_commit/when_API_call_is_valid.json +1 -1
  49. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_commit/when_API_call_is_valid/returns_commit.json +1 -1
  50. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_date_of_tag/when_API_call_is_valid.json +1 -1
  51. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_date_of_tag/when_API_call_is_valid/returns_date.json +1 -1
  52. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_events_async/when_API_call_is_valid.json +1 -1
  53. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_events_async/when_API_call_is_valid/populates_issues.json +1 -1
  54. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid.json +1 -1
  55. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid/should_return_tags.json +1 -1
  56. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid/should_return_tags_count.json +1 -1
  57. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_wrong_token_provided.json +1 -1
  58. data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_wrong_token_provided/should_raise_Unauthorized_error.json +1 -1
  59. metadata +71 -38
  60. data/bin/ghclgen +0 -5
  61. data/lib/github_changelog_generator/generator/generator_generation.rb +0 -180
  62. data/spec/unit/generator/generator_generation_spec.rb +0 -73
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 55def2416dfef54779832b68f186965d4c62bbd0
4
- data.tar.gz: c9f978a6b01aab0356b676e7749f1b25d4aacc93
2
+ SHA256:
3
+ metadata.gz: 013fbbe19a6a0f7fc005969b45cf8a7e21697551c1de0e6074d00b0a86c1621e
4
+ data.tar.gz: 6ae152e9815faf93bce42d0fe24653f65181e3cd0b0e7b069ea969015396c415
5
5
  SHA512:
6
- metadata.gz: acdbbbae3679145b85639750184fffd39efe3d94ea2447f3429341655bd9ea94860f1a1eea65f970437ae2894aeffc145685ef34cda687acf90123d45dc7b6b0
7
- data.tar.gz: 7cf8cf180df005695f5d3882299ce4ad4ef3b504dd0bfbba9806efe925fc1ebc666224b00eacbeda63add590ccd3b74ad19b40032c4fb70df07778cca444c29a
6
+ metadata.gz: 7c7fff39381df3062e74cec927bac6501663b146022fa4b8e604514c182c8353021b3dbc3553900d7b10dbd9ca42a9abe33c9284f75040678c0cd97ece402598
7
+ data.tar.gz: 2c928e7634981f5c3f611770b317f289152269028441e522694c36b51349e8b935e578257b62d076ff20ddef4f461dd345ed87565badaf14d5c26230d6e4b86d
data/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
1
  The MIT License (MIT)
2
- Copyright (c) 2016-2017 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,285 +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
-
34
- 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.
35
-
36
- ### *Why should I care?*
37
-
38
- Because software tools are for _people_. "Changelogs make it easier for users and
39
- contributors to see precisely what notable changes have been made between each
40
- release (or version) of the project."
41
-
42
- :arrow_right: *[http://keepachangelog.com](http://keepachangelog.com)*
43
-
44
- ## Installation
45
-
46
- gem install github_changelog_generator
47
-
48
- See also Troubleshooting.
49
-
50
- ## Output example
51
-
52
- - Look at **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project
53
- - [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command:
54
-
55
- github_changelog_generator -u skywinder -p ActionSheetPicker-3.0
56
-
57
- - In general, it looks like this:
58
-
59
- > ## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
60
- >
61
- > [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
62
- >
63
- > **Implemented enhancements:**
64
- >
65
- > - Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
66
- >
67
- > **Fixed bugs:**
68
- >
69
- > - Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
70
- >
71
- > **Merged pull requests:**
72
- >
73
- > - PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
74
- >
75
- > - support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
76
-
77
-
78
- ## Usage
79
-
80
- - Run this:
81
-
82
- `github_changelog_generator -u github_username -p github_project`
83
- `github_changelog_generator github_username/github_project`
84
-
85
- - For Github Enterprise repos, specify *both* `--github-site` and `--github-api` options:
86
-
87
- github_changelog_generator --github-site="https://github.yoursite.com" \
88
- --github-api="https://github.yoursite.com/api/v3/"
89
-
90
- This generates a `CHANGELOG.md`, with pretty Markdown formatting.
91
-
92
- ### Params
93
-
94
- Type `github_changelog_generator --help` for details.
95
-
96
- 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)
97
-
98
- ### Params File
99
-
100
- In your project root, you can put a params file named `.github_changelog_generator` to override default params:
101
-
102
- Example:
103
-
104
- ```
105
- unreleased=false
106
- future-release=5.0.0
107
- since-tag=1.0.0
108
- ```
109
-
110
- ### GitHub token
111
-
112
- GitHub only allows 50 unauthenticated requests per hour.
113
-
114
- Therefore, it's recommended to run this script with authentication by using a **token**.
115
-
116
- Here's how:
117
-
118
- - [Generate a token here](https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token) - you only need "repo" scope for private repositories
119
- - Either:
120
- - Run the script with `--token <your-40-digit-token>`; **OR**
121
- - Set the `CHANGELOG_GITHUB_TOKEN` environment variable to your 40 digit token
122
-
123
- 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`):
124
-
125
- export CHANGELOG_GITHUB_TOKEN="«your-40-digit-github-token»"
126
-
127
- So, if you get a message like this:
128
-
129
- ``` markdown
130
- API rate limit exceeded for github_username.
131
- See: https://developer.github.com/v3/#rate-limiting
132
- ```
133
-
134
- It's time to create this token! (Or, wait an hour for GitHub to reset your unauthenticated request limit.)
135
-
136
- ## Migrating from a manual changelog
137
-
138
- Knowing how dedicated you are to your project, you probably haven't been waiting for `github-changelog-generator` to keep a changelog.
139
- But you probably don't want your project's open issues and PRs for all past features listed in your historic changelog, either.
140
-
141
- That's where `--base <your-manual-changelog.md>` comes in handy!
142
- This option lets append your old manual changelog to the end of the generated entries.
143
-
144
- If you have a `HISTORY.md` file in your project, it will automatically be picked as the static historical changelog and appended.
145
-
146
- ### Rake task
147
-
148
- You love `rake`? We do, too! So, we've made it even easier for you:
149
- we've provided a `rake` task library for your changelog generation.
150
-
151
- Configure the task in your `Rakefile`:
152
-
153
- ```ruby
154
- require 'github_changelog_generator/task'
155
-
156
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
157
- config.since_tag = '0.1.14'
158
- config.future_release = '0.2.0'
159
- end
160
- ```
161
-
162
- All command-line options can be passed to the `rake` task as `config`
163
- parameters. And since you're naming the `rake` task yourself, you can create
164
- as many as you want.
165
-
166
- 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.
167
-
168
- ## Features and advantages of this project
169
-
170
- - Generate canonical, neat change log file, followed by [basic change log guidelines](http://keepachangelog.com) :gem:
171
- - Optionally generate **Unreleased** changes (closed issues that have not released yet) :dizzy:
172
- - **GitHub Enterprise support** via command line options! :factory:
173
- - Flexible format **customization**:
174
- - **Customize** issues that **should be added** to changelog :eight_spoked_asterisk:
175
- - **Custom date formats** supported (but keep [ISO 8601](http://xkcd.com/1179/) in mind!) :date:
176
- - 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:
177
- - Automatically **exclude specific issues** that are irrelevant to your changelog (by default, any issue labeled `question`, `duplicate`, `invalid`, or `wontfix`) :scissors:
178
- - **Distinguish** issues **by labels**. :mag_right:
179
- - Merged pull requests (all merged pull-requests) :twisted_rightwards_arrows:
180
- - Bug fixes (issues labeled `bug`) :beetle:
181
- - Enhancements (issues labeled `enhancement`) :star2:
182
- - Issues (closed issues with no labels) :non-potable_water:
183
-
184
- - Manually include or exclude issues by labels :wrench:
185
- - Customize lots more! Tweak the changelog to fit your preferences :tophat:
186
- (*See `github_changelog_generator --help` for details)*
187
-
188
-
189
- ### Alternatives
190
-
191
- Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives) that I found. But none satisfied my requirements.
192
-
193
- *If you know other projects, feel free to edit this Wiki page!*
194
-
195
-
196
- ### Projects using this library
197
-
198
- Here's a [wikipage list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator).
199
-
200
- 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.
201
-
202
- *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).*
203
-
204
- ## Am I missing some essential feature?
205
-
206
- - **Nothing is impossible!**
207
-
208
- - Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make the generator better together!
209
-
210
- - *Bug reports, feature requests, patches, and well-wishes are always welcome.* :heavy_exclamation_mark:
211
-
212
- ## FAQ
213
-
214
- - ***I already use GitHub Releases. Why do I need this?***
215
-
216
- 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:
217
-
218
- *BTW: I would like to support GitHub Releases in [next releases](https://github.com/skywinder/github-changelog-generator/issues/56) ;)*
219
-
220
- I'm not trying to compare the quality of handwritten and auto-generated logs. That said....
221
-
222
- An auto-generated changelog really helps, even if you manually fill in the release notes!
223
-
224
- For example:
225
-
226
- When you find a closed bug, it is very useful to know which release fixed it.
227
- So that you can easily find the issue by \# in `CHANGELOG.md`.
228
-
229
- - it's not quite as easy to find this in handwritten releases notes
230
- - a generated file saves you the trouble of remembering everything;
231
- sometimes people forget to add things to a handwritten file
232
-
233
- Ultimately, I think GitHub Releases are ideal for end-users.
234
- Meanwhile, `CHANGELOG.md` lives right in the repository, with its detailed list of changes, which is handy for developers.
235
- Finally, there's nothing wrong with using GitHub Releases alongside `CHANGELOG.md` in this combination.
236
-
237
- - ***I received a warning: "GitHub API rate limit exceed" What does this mean?***
238
-
239
- 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).
240
-
241
- If you're seeing this warning, please do the following:
242
-
243
- 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.
244
- 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`
245
-
246
- - ***My Ruby version is very old, can I use this?***
247
-
248
- When your Ruby is old, and you don't want to upgrade, and you want to
249
- control which libraries you use, you can use Bundler.
250
-
251
- In a Gemfile, perhaps in a non-deployed `:development` group, add this
252
- gem:
253
-
254
- ```ruby
255
- group :development do
256
- gem 'github_changelog_generator', require: false
257
- end
258
- ```
259
-
260
- Then you can keep back dependencies like rack, which currently is only
261
- compatible with Ruby >= 2.2.2. So, use an older version for your app by
262
- adding a line like this to the Gemfile:
263
-
264
- ```
265
- gem 'rack', '~> 1.6'
266
- ```
267
-
268
- This way, you can keep on using github_changelog_generator, even if you
269
- can't get the latest version of Ruby installed.
270
-
271
- ## Contributing
272
-
273
- 1. Create an issue and describe your idea
274
- 2. [Fork it](https://github.com/skywinder/github-changelog-generator/fork)
275
- 3. Create your feature branch (`git checkout -b my-new-feature`)
276
- 4. Commit your changes (`git commit -am 'Add some feature'`)
277
- 5. Publish the branch (`git push origin my-new-feature`)
278
- 6. Create a new Pull Request
279
- 7. Profit! :white_check_mark:
280
-
281
- You can test your workflow with changelog generator with [the skywinder/changelog_test repo](https://github.com/skywinder/changelog_test/).
282
-
283
- ## License
284
-
285
- 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).