mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
utils/github: remove unnecessary chdir
call
The only existing caller already has the requested directory as the workign directory, so this is currently not needed.
This commit is contained in:
parent
05337cbb79
commit
d372eb86ca
@ -482,7 +482,7 @@ module Homebrew
|
||||
|
||||
ohai "Downloading bottles for workflow: #{workflow}"
|
||||
url = GitHub.get_artifact_url(workflow_run)
|
||||
GitHub.download_artifact(url, pr, dir)
|
||||
GitHub.download_artifact(url, pr)
|
||||
end
|
||||
|
||||
next if args.no_upload?
|
||||
|
@ -372,7 +372,14 @@ module GitHub
|
||||
artifact.last["archive_download_url"]
|
||||
end
|
||||
|
||||
def self.download_artifact(url, artifact_id, dir = Pathname.pwd)
|
||||
# Downloads an artifact from GitHub Actions.
|
||||
#
|
||||
# @param url [String] URL to download from
|
||||
# @param artifact_id [String] a value that uniquely identifies the downloaded artifact
|
||||
#
|
||||
# @api private
|
||||
sig { params(url: String, artifact_id: String).void }
|
||||
def self.download_artifact(url, artifact_id)
|
||||
odie "Credentials must be set to access the Artifacts API" if API.credentials_type == :none
|
||||
|
||||
token = API.credentials
|
||||
@ -381,17 +388,15 @@ module GitHub
|
||||
# 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.
|
||||
FileUtils.chdir dir do
|
||||
downloader = GitHubArtifactDownloadStrategy.new(
|
||||
url,
|
||||
"artifact",
|
||||
artifact_id,
|
||||
curl_args: curl_args,
|
||||
secrets: [token],
|
||||
)
|
||||
downloader.fetch
|
||||
downloader.stage
|
||||
end
|
||||
downloader = GitHubArtifactDownloadStrategy.new(
|
||||
url,
|
||||
"artifact",
|
||||
artifact_id,
|
||||
curl_args: curl_args,
|
||||
secrets: [token],
|
||||
)
|
||||
downloader.fetch
|
||||
downloader.stage
|
||||
end
|
||||
|
||||
def self.public_member_usernames(org, per_page: 100)
|
||||
|
Loading…
x
Reference in New Issue
Block a user