Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

When we have merged_at info, just use that, because a PR's merge event commit date seems to merely be the date of the last commit, which is often very different than the date the PR was merged.#620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletionslib/github_changelog_generator/generator/generator_fetcher.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
# frozen_string_literal: true

module GitHubChangelogGenerator
class Generator
MAX_THREAD_NUMBER = 25
Expand DownExpand Up@@ -49,18 +48,22 @@ def detect_actual_closed_dates(issues)
end

# Fill :actual_date parameter of specified issue by closed date of the commit, if it was closed by commit.
# Or by merged_at, if that info exists.
# @param [Hash] issue
def find_closed_date_by_commit(issue)
unless issue["events"].nil?
# if it's PR -> then find "merged event", in case of usual issue -> fond closed date
compare_string = issue["merged_at"].nil? ? "closed" : "merged"
# reverse! - to find latest closed event. (event goes in date order)
issue["events"].reverse!.each do |event|
if event["event"].eql? compare_string
set_date_from_event(event, issue)
break
# in case of usual issue with no merge, find closed date.
if issue["merged_at"].nil?
unless issue["events"].nil?
# reverse! - to find latest closed event. (event goes in date order)
issue["events"].reverse!.each do |event|
if event["event"].eql? compare_string
set_date_from_event(event, issue)
break
end
end
end
else # if it's a PR, then go based on the merge event itself.
issue["actual_date"] = issue["merged_at"]
end
# TODO: assert issues, that remain without 'actual_date' hash for some reason.
end
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp