Extract username tagging
This commit is contained in:
parent
df31f98ce3
commit
4c737c9373
|
@ -160,7 +160,7 @@ module GitHubChangelogGenerator
|
||||||
# Parse issue and generate single line formatted issue line.
|
# Parse issue and generate single line formatted issue line.
|
||||||
#
|
#
|
||||||
# Example output:
|
# Example output:
|
||||||
# - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder))
|
# - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) (@skywinder)
|
||||||
#
|
#
|
||||||
# @param [Hash] issue Fetched issue from GitHub
|
# @param [Hash] issue Fetched issue from GitHub
|
||||||
# @return [String] Markdown-formatted single issue
|
# @return [String] Markdown-formatted single issue
|
||||||
|
@ -168,21 +168,22 @@ module GitHubChangelogGenerator
|
||||||
encapsulated_title = encapsulate_string issue[:title]
|
encapsulated_title = encapsulate_string issue[:title]
|
||||||
|
|
||||||
title_with_number = "#{encapsulated_title} [\\##{issue[:number]}](#{issue.html_url})"
|
title_with_number = "#{encapsulated_title} [\\##{issue[:number]}](#{issue.html_url})"
|
||||||
|
issue_line_with_user(title_with_number, issue)
|
||||||
unless issue.pull_request.nil?
|
end
|
||||||
if @options[:author]
|
|
||||||
if issue.user.nil?
|
private
|
||||||
title_with_number += " ({Null user})"
|
|
||||||
else
|
def issue_line_with_user(line, issue)
|
||||||
if issue.user.html_url.exclude? "github.com"
|
return line if !@options[:author] || issue.pull_request.nil?
|
||||||
title_with_number += " ([#{issue.user.login}](#{issue.user.html_url}))"
|
|
||||||
else
|
user = issue.user
|
||||||
title_with_number += " (@#{issue.user.login})"
|
return "#{line} ({Null user})" unless user
|
||||||
end
|
|
||||||
end
|
if user.html_url.include?("github.com")
|
||||||
end
|
"#{line} (@#{user.login})"
|
||||||
|
else
|
||||||
|
"#{line} ([#{user.login}](#{user.html_url}))"
|
||||||
end
|
end
|
||||||
title_with_number
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user