Skip to content

Commit f7e41ee

Browse files
committed
[CI] Adds branch option to docs report download
1 parent c6954fc commit f7e41ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rake_tasks/doc_generator.rake

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace :docs do
4646
end
4747

4848
desc 'Update report'
49-
task :update do
49+
task :update, [:branch] do |_, args|
5050
require 'elastic-transport'
5151
github_token = File.read(File.expand_path("~/.elastic/github.token"))
5252
transport_options = {
@@ -60,9 +60,11 @@ namespace :docs do
6060
transport_options:transport_options
6161
)
6262
path = '/repos/elastic/clients-flight-recorder/contents/recordings/docs/parsed-alternative-report.json'
63+
path = "#{path}?ref=#{args[:branch]}" if args[:branch]
6364
params = {}
6465
response = client.perform_request('GET', path, params)
6566
File.write(File.expand_path('./docs/parsed_alternative_report.json', __dir__), response.body)
67+
puts "Downloaded report for #{args[:branch] ? args[:branch] : 'main' } branch"
6668
end
6769

6870
def json_data

0 commit comments

Comments
 (0)