Skip to content

Commit e9df375

Browse files
Ensure docs gen inserts at correct place in file (#18250) (#18259)
The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found. (cherry picked from commit a3228e2) Co-authored-by: Cas Donoghue <[email protected]>
1 parent 587d256 commit e9df375

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/release/generate_release_notes_md.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
coming_tag_index = release_notes.find_index {|line| line.match(/^## #{current_release} \[logstash-#{current_release}-release-notes\]$/) }
4444
coming_tag_index += 1 if coming_tag_index
45-
release_notes_entry_index = coming_tag_index || release_notes.find_index {|line| line.match(/\[logstash-\d+-release-notes\]$/) }
45+
release_notes_entry_index = coming_tag_index || release_notes.find_index {|line| line.match(/^## .*\[logstash-.*-release-notes\]$/) }
4646

4747
unless coming_tag_index
4848
report << "## #{current_release} [logstash-#{current_release}-release-notes]\n\n"

0 commit comments

Comments
 (0)