diff --git a/tools/release/generate_release_notes_md.rb b/tools/release/generate_release_notes_md.rb index cedf0e6ec63..d2c16c339f1 100755 --- a/tools/release/generate_release_notes_md.rb +++ b/tools/release/generate_release_notes_md.rb @@ -91,15 +91,17 @@ plugin_changes.each do |plugin, versions| _, type, name = plugin.split("-") header = "**#{name.capitalize} #{type.capitalize} - #{versions.last}**" + # Determine the correct GitHub organization + org = plugin.include?('elastic_integration') ? 'elastic' : 'logstash-plugins' start_changelog_file = Tempfile.new(plugin + 'start') end_changelog_file = Tempfile.new(plugin + 'end') - changelog = `curl https://raw.githubusercontent.com/logstash-plugins/#{plugin}/v#{versions.last}/CHANGELOG.md`.split("\n") + changelog = `curl https://raw.githubusercontent.com/#{org}/#{plugin}/v#{versions.last}/CHANGELOG.md`.split("\n") report << "#{header}\n" changelog.each do |line| break if line.match(/^## #{versions.first}/) next if line.match(/^##/) line.gsub!(/^\+/, "") - line.gsub!(/ #(?\d+)\s*$/, " https://github.com/logstash-plugins/#{plugin}/issues/\\k[#\\k]") + line.gsub!(/ #(?\d+)\s*$/, " https://github.com/#{org}/#{plugin}/issues/\\k[#\\k]") line.gsub!(/\[#(?\d+)\]\((?[^)]*)\)/, "[#\\k](\\k)") line.gsub!(/^\s+-/, "*") report << line