GitHubArtifactDownloadStrategy: fix initialize signature
This commit is contained in:
parent
ee6ef00a73
commit
9260bd97e8
@ -637,9 +637,10 @@ end
|
||||
#
|
||||
# @api private
|
||||
class GitHubArtifactDownloadStrategy < AbstractFileDownloadStrategy
|
||||
def initialize
|
||||
super
|
||||
def initialize(url, artifact_id, token:)
|
||||
super(url, "artifact", artifact_id)
|
||||
@cache = HOMEBREW_CACHE/"gh-actions-artifact"
|
||||
@token = token
|
||||
end
|
||||
|
||||
def fetch(timeout: nil)
|
||||
@ -649,8 +650,8 @@ class GitHubArtifactDownloadStrategy < AbstractFileDownloadStrategy
|
||||
else
|
||||
begin
|
||||
curl "--location", "--create-dirs", "--output", temporary_path, url,
|
||||
*meta.fetch(:curl_args, []),
|
||||
secrets: meta.fetch(:secrets, []),
|
||||
"--header", "Authorization: token #{@token}",
|
||||
secrets: [@token],
|
||||
timeout: timeout
|
||||
rescue ErrorDuringExecution
|
||||
raise CurlDownloadStrategyError, url
|
||||
|
||||
@ -383,18 +383,11 @@ module GitHub
|
||||
odie "Credentials must be set to access the Artifacts API" if API.credentials_type == :none
|
||||
|
||||
token = API.credentials
|
||||
curl_args = ["--header", "Authorization: token #{token}"]
|
||||
|
||||
# Download the artifact as a zip file and unpack it into `dir`. This is
|
||||
# preferred over system `curl` and `tar` as this leverages the Homebrew
|
||||
# cache to avoid repeated downloads of (possibly large) bottles.
|
||||
downloader = GitHubArtifactDownloadStrategy.new(
|
||||
url,
|
||||
"artifact",
|
||||
artifact_id,
|
||||
curl_args: curl_args,
|
||||
secrets: [token],
|
||||
)
|
||||
downloader = GitHubArtifactDownloadStrategy.new(url, artifact_id, token: token)
|
||||
downloader.fetch
|
||||
downloader.stage
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user