Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99d20bd8a9 | ||
|
|
f0e713d6ef | ||
|
|
8dc50cf483 | ||
|
|
90c455ada4 | ||
|
|
088824aa05 | ||
|
|
96977c8384 | ||
|
|
1940974c4c | ||
|
|
1fced7278e | ||
|
|
eb9bd59f26 | ||
|
|
41f43932e0 | ||
|
|
4ba7bbcc90 | ||
|
|
8505d340af | ||
|
|
f3c05bd01c | ||
|
|
4bcf49175b | ||
|
|
6c28db6d4a | ||
|
|
6f8aee6a4b | ||
|
|
3e3cc15592 | ||
|
|
d5edb1f606 | ||
|
|
e6d0c3d791 | ||
|
|
c1d28d486f | ||
|
|
fa713af816 | ||
|
|
17f7127de1 | ||
|
|
e1a264e2c9 | ||
|
|
e4b79e75ca | ||
|
|
c7a767451d | ||
|
|
01f44b8311 | ||
|
|
c0015a2c22 | ||
|
|
49cb6589f7 |
67
CHANGELOG.md
67
CHANGELOG.md
@@ -1,6 +1,23 @@
|
||||
# Changelog
|
||||
|
||||
## [1.2.4] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4)
|
||||
## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6)
|
||||
#### 21/01/15
|
||||
- *Merged pull-request:* fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao))
|
||||
|
||||
## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
|
||||
#### 15/01/15
|
||||
- *Merged pull-request:* PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
|
||||
|
||||
- *Merged pull-request:* support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
|
||||
|
||||
- *Implemented enhancement:* Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
|
||||
|
||||
- *Fixed bug:* Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
|
||||
|
||||
## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4)
|
||||
#### 16/12/14
|
||||
- *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
@@ -12,21 +29,29 @@
|
||||
|
||||
- *Fixed bug:* Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30)
|
||||
|
||||
## [1.2.3] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3)
|
||||
#### 16/12/14
|
||||
- *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34)
|
||||
- *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35)
|
||||
|
||||
## [1.2.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2)
|
||||
## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3)
|
||||
#### 16/12/14
|
||||
## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2)
|
||||
#### 10/12/14
|
||||
- *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef))
|
||||
|
||||
## [1.2.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1)
|
||||
- *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34)
|
||||
|
||||
## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1)
|
||||
#### 22/11/14
|
||||
- *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Merged pull-request:* Disable default --filter-pull-requests option. [\#28](https://github.com/skywinder/Github-Changelog-Generator/pull/28) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.2.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0)
|
||||
- *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20)
|
||||
|
||||
## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0)
|
||||
#### 19/11/14
|
||||
- *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
@@ -36,21 +61,22 @@
|
||||
|
||||
- *Merged pull-request:* Don't receive issues in case of --no-isses flag specied [\#24](https://github.com/skywinder/Github-Changelog-Generator/pull/24) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.1.4] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4)
|
||||
## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4)
|
||||
#### 18/11/14
|
||||
- *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Implemented enhancement:* Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19)
|
||||
|
||||
- *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20)
|
||||
|
||||
## [1.1.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2)
|
||||
## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2)
|
||||
#### 12/11/14
|
||||
- *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.1.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1)
|
||||
## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1)
|
||||
#### 10/11/14
|
||||
- *Merged pull-request:* Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
@@ -58,7 +84,8 @@
|
||||
|
||||
- *Merged pull-request:* Add ability to add or exclude issues without any labels [\#13](https://github.com/skywinder/Github-Changelog-Generator/pull/13) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.1.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0)
|
||||
## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0)
|
||||
#### 10/11/14
|
||||
- *Implemented enhancement:* Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11)
|
||||
|
||||
@@ -66,11 +93,13 @@
|
||||
|
||||
- *Fixed bug:* Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12)
|
||||
|
||||
## [1.0.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1)
|
||||
## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1)
|
||||
#### 10/11/14
|
||||
- *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.0.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0)
|
||||
## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0)
|
||||
#### 07/11/14
|
||||
- *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
@@ -82,15 +111,17 @@
|
||||
|
||||
- *Fixed bug:* Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5)
|
||||
|
||||
## [0.1.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0)
|
||||
## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0)
|
||||
#### 07/11/14
|
||||
- *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Merged pull-request:* Add option \(-o --output\) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [0.0.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2)
|
||||
## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2)
|
||||
#### 06/11/14
|
||||
## [0.0.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1)
|
||||
## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1)
|
||||
#### 06/11/14
|
||||
|
||||
|
||||
|
||||
10
README.md
10
README.md
@@ -16,15 +16,15 @@ You're almost done!
|
||||
## Usage
|
||||
**It's really simple**:
|
||||
|
||||
- If your **git remote** `origin` refer to your GitHub repo, then just go to your project folder just run:
|
||||
- If your **git remote** `origin` refer to your GitHub repo, then just go to your project folder and run:
|
||||
|
||||
github_changelog_generator
|
||||
|
||||
- or from anywhere:
|
||||
|
||||
github_changelog_generator -u github-username -p github-project
|
||||
github_changelog_generator -u github_username -p github_project
|
||||
|
||||
As output you will get `CHANGELOG.md` file with *pretty Markdown-formatted* changelog.
|
||||
As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog.
|
||||
|
||||
### Params:
|
||||
Type `github_changelog_generator --help` for detailed usage.
|
||||
@@ -57,7 +57,9 @@ And:
|
||||
- Run with key `-t [your-16-digit-token]`
|
||||
- Or set environment variable `CHANGELOG_GITHUB_TOKEN` and specify there your token.
|
||||
|
||||
i.e. add to your `~/.bash_profile` or `~/.zshrc` or any other place to load ENV variables string `export CHANGELOG_GITHUB_TOKEN="your-40-digit-github-token"'`
|
||||
i.e. add to your `~/.bash_profile` or `~/.zshrc` or any other place to load ENV variables string :
|
||||
|
||||
export CHANGELOG_GITHUB_TOKEN="your-40-digit-github-token"
|
||||
|
||||
So, if you got error like this:
|
||||
>! /Library/Ruby/Gems/2.0.0/gems/github_api-0.12.2/lib/github_api/response/raise_error.rb:14:in `on_complete'
|
||||
|
||||
@@ -240,10 +240,12 @@ module GitHubChangelogGenerator
|
||||
newer_tag_name = newer_tag['name']
|
||||
|
||||
if older_tag.nil?
|
||||
older_tag_name = nil
|
||||
filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time)
|
||||
filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time)
|
||||
else
|
||||
older_tag_time = self.get_time_of_tag(older_tag)
|
||||
older_tag_name = older_tag['name']
|
||||
filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time, older_tag_time)
|
||||
filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time)
|
||||
end
|
||||
@@ -285,7 +287,7 @@ module GitHubChangelogGenerator
|
||||
filtered_issues |= issues_to_add
|
||||
end
|
||||
|
||||
self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time)
|
||||
self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time, older_tag_name)
|
||||
|
||||
end
|
||||
|
||||
@@ -311,20 +313,28 @@ module GitHubChangelogGenerator
|
||||
}
|
||||
end
|
||||
|
||||
# @param [Array] pull_requests
|
||||
# @param [Array] issues
|
||||
# @param [String] tag_name
|
||||
# @param [String] tag_time
|
||||
# @return [String]
|
||||
def create_log(pull_requests, issues, tag_name, tag_time)
|
||||
# @param [Array] pull_requests
|
||||
# @param [Array] issues
|
||||
# @param [String] newer_tag_name
|
||||
# @param [String] newer_tag_time
|
||||
# @param [String] older_tag_name
|
||||
# @return [String]
|
||||
def create_log(pull_requests, issues, newer_tag_name, newer_tag_time, older_tag_name = nil)
|
||||
|
||||
github_site = options[:github_site] || 'https://github.com'
|
||||
|
||||
project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}"
|
||||
|
||||
# Generate tag name and link
|
||||
log = "## [#{tag_name}] (#{github_site}/#{@options[:user]}/#{@options[:project]}/tree/#{tag_name})\n"
|
||||
log = "## [#{newer_tag_name}](#{project_url}/tree/#{newer_tag_name})\n"
|
||||
|
||||
if @options[:compare_link] && older_tag_name
|
||||
# Generate compare link
|
||||
log += "[Full Changelog](#{project_url}/compare/#{older_tag_name}...#{newer_tag_name})\n"
|
||||
end
|
||||
|
||||
#Generate date string:
|
||||
time_string = tag_time.strftime @options[:format]
|
||||
time_string = newer_tag_time.strftime @options[:format]
|
||||
log += "#### #{time_string}\n"
|
||||
|
||||
if @options[:pulls]
|
||||
|
||||
@@ -6,7 +6,7 @@ require_relative 'version'
|
||||
module GitHubChangelogGenerator
|
||||
class Parser
|
||||
def self.parse_options
|
||||
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true}
|
||||
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true}
|
||||
|
||||
parser = OptionParser.new { |opts|
|
||||
opts.banner = 'Usage: changelog_generator [options]'
|
||||
@@ -43,6 +43,9 @@ module GitHubChangelogGenerator
|
||||
opts.on('--[no-]author', 'Add author of pull-request in the end. Default is true') do |author|
|
||||
options[:last] = author
|
||||
end
|
||||
opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v|
|
||||
options[:compare_link] = v
|
||||
end
|
||||
opts.on('--labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list|
|
||||
options[:labels] = list
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module GitHubChangelogGenerator
|
||||
VERSION = '1.2.5'
|
||||
VERSION = '1.2.7'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user