utils/github/artifacts: Bump to Sorbet typed: strict

This commit is contained in:
Issy Long 2024-07-17 16:19:12 -04:00
parent 5b84ee0195
commit 07f9f3f8e0
No known key found for this signature in database

View File

@ -1,4 +1,4 @@
# typed: true # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
require "download_strategy" require "download_strategy"
@ -24,12 +24,14 @@ end
# Strategy for downloading an artifact from GitHub Actions. # Strategy for downloading an artifact from GitHub Actions.
class GitHubArtifactDownloadStrategy < AbstractFileDownloadStrategy class GitHubArtifactDownloadStrategy < AbstractFileDownloadStrategy
sig { params(url: String, artifact_id: String, token: String).void }
def initialize(url, artifact_id, token:) def initialize(url, artifact_id, token:)
super(url, "artifact", artifact_id) super(url, "artifact", artifact_id)
@cache = HOMEBREW_CACHE/"gh-actions-artifact" @cache = T.let(HOMEBREW_CACHE/"gh-actions-artifact", Pathname)
@token = token @token = T.let(token, String)
end end
sig { params(timeout: T.nilable(Integer)).void }
def fetch(timeout: nil) def fetch(timeout: nil)
ohai "Downloading #{url}" ohai "Downloading #{url}"
if cached_location.exist? if cached_location.exist?