We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5fcc97 commit 0423246Copy full SHA for 0423246
report/download_artifacts.rb
@@ -31,14 +31,16 @@ class << self
31
# download the branch.
32
#
33
def version
34
- if ENV['BRANCH']
+ if ENV['STACK_VERSION']
35
+ ENV['STACK_VERSION']
36
+ elsif (branch = ENV['BRANCH'])
37
require 'open-uri'
38
require 'yaml'
-
- versions = URI.open("https://snapshots.elastic.co/latest/#{ENV['BRANCH']}.json").read
39
+ branch = 'master' if branch == 'main' # main is 404 for now
40
+ versions = URI.open("https://snapshots.elastic.co/latest/#{branch}.json").read
41
YAML.safe_load(versions)['version']
42
else
- ENV['STACK_VERSION'] || read_version_from_github
43
+ read_version_from_github
44
end
45
46
0 commit comments