Context
Using Ruby, I’m trying to get the content of the last artifact that is a result of a SimpleCov coverage report.
I’m able so far to retrieve the last artifact with this code (using an Access Token) :
module Ci
class Circle
# more code
def artifacts
@artifacts = self.class.get("/project/github/#{@user}/#{@project}/latest/artifacts?circle-token=#{ENV['CI_ACCESS_TOKEN']}")
self
end
# more code
end
end
Then, I’m retrieving the index page which I want to get the content from, with this code:
def report
artifacts = JSON.parse(@artifacts.parsed_response)
artifacts.each do |response|
url = response['url']
return url if url.end_with? '.html'
end
nil
end
Problem
I want to get the content of the coverage page, located at https://3-57932222-gh.circle-artifacts.com/0//tmp/circle-artifacts.64VZY8w/coverage/index.html
, but when logged out, it shows Must be log in
. I’ve tried to check the CircleCI documentation but were not able to find out how to pass an access token to this page in order to get it’s content from the command line (where I’m obviously not log in). Ideas?