File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ namespace :docs do
46
46
end
47
47
48
48
desc 'Update report'
49
- task :update do
49
+ task :update , [ :branch ] do | _ , args |
50
50
require 'elastic-transport'
51
51
github_token = File . read ( File . expand_path ( "~/.elastic/github.token" ) )
52
52
transport_options = {
@@ -60,9 +60,11 @@ namespace :docs do
60
60
transport_options :transport_options
61
61
)
62
62
path = '/repos/elastic/clients-flight-recorder/contents/recordings/docs/parsed-alternative-report.json'
63
+ path = "#{ path } ?ref=#{ args [ :branch ] } " if args [ :branch ]
63
64
params = { }
64
65
response = client . perform_request ( 'GET' , path , params )
65
66
File . write ( File . expand_path ( './docs/parsed_alternative_report.json' , __dir__ ) , response . body )
67
+ puts "Downloaded report for #{ args [ :branch ] ? args [ :branch ] : 'main' } branch"
66
68
end
67
69
68
70
def json_data
You can’t perform that action at this time.
0 commit comments