release_notes: use safe_popen_read.
Otherwise if `git log` fails (e.g. due to missing `origin/HEAD` in my case) then it will generate a release with empty release notes.
This commit is contained in:
parent
265c8c36a4
commit
40b2340ba3
@ -14,7 +14,7 @@ module ReleaseNotes
|
|||||||
.returns(String)
|
.returns(String)
|
||||||
}
|
}
|
||||||
def generate_release_notes(start_ref, end_ref, markdown: false)
|
def generate_release_notes(start_ref, end_ref, markdown: false)
|
||||||
Utils.popen_read(
|
Utils.safe_popen_read(
|
||||||
"git", "-C", HOMEBREW_REPOSITORY, "log", "--pretty=format:'%s >> - %b%n'", "#{start_ref}..#{end_ref}"
|
"git", "-C", HOMEBREW_REPOSITORY, "log", "--pretty=format:'%s >> - %b%n'", "#{start_ref}..#{end_ref}"
|
||||||
).lines.map do |s|
|
).lines.map do |s|
|
||||||
matches = s.match(%r{.*Merge pull request #(?<pr>\d+) from (?<user>[^/]+)/[^>]*>> - (?<body>.*)})
|
matches = s.match(%r{.*Merge pull request #(?<pr>\d+) from (?<user>[^/]+)/[^>]*>> - (?<body>.*)})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user