File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments