File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
_tools/changelog_generator Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 3
3
require "optparse"
4
4
require "json"
5
5
6
+ REPO_NAME = "ruby-go-gem/go-gem-wrapper"
7
+
6
8
# @return [String]
7
9
def search_git_tags
8
10
releases = JSON . parse ( `gh release list --json tagName` )
@@ -14,11 +16,12 @@ def search_git_tags
14
16
# @param after [String]
15
17
# @return [Array<Integer>]
16
18
def search_pr_numbers ( before :, after :)
17
- commits = `git rev-list --merges --right-only #{ before } ...#{ after } ` . each_line . map ( &:strip )
18
- commits . map do |commit |
19
- commit_message = `git show -q #{ commit } `
20
- commit_message =~ /Merge pull request #([0-9]+)/
21
- Regexp . last_match ( 1 ) . to_i
19
+ endpoint = "/repos/#{ REPO_NAME } /compare/#{ before } ...#{ after } "
20
+ res = JSON . parse ( `gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" #{ endpoint } ` )
21
+ res [ "commits" ] . filter_map do |commit |
22
+ commit_message = commit [ "commit" ] [ "message" ]
23
+
24
+ Regexp . last_match ( 1 ) . to_i if commit_message =~ /Merge pull request #([0-9]+)/
22
25
end
23
26
end
24
27
You can’t perform that action at this time.
0 commit comments