Update default artifact pattern to avoid migration problems

This commit is contained in:
Ruoyu Zhong 2024-04-17 05:52:11 +08:00
parent d6d1b7d4e9
commit dd92ad8e1b
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View File

@ -56,7 +56,7 @@ module Homebrew
depends_on: "--autosquash",
description: "Message to include when autosquashing revision bumps, deletions and rebuilds."
flag "--artifact-pattern=", "--artifact=",
description: "Download artifacts with the specified pattern (default: `bottles{,-*}`)."
description: "Download artifacts with the specified pattern (default: `bottles{,_*}`)."
flag "--tap=",
description: "Target tap repository (default: `homebrew/core`)."
flag "--root-url=",
@ -81,7 +81,7 @@ module Homebrew
ensure_executable!("unzip", reason: "extracting CI artifacts")
workflows = args.workflows.presence || ["tests.yml"]
artifact_pattern = args.artifact_pattern || "bottles{,-*}"
artifact_pattern = args.artifact_pattern || "bottles{,_*}"
tap = Tap.fetch(args.tap || CoreTap.instance.name)
raise TapUnavailableError, tap.name unless tap.installed?
@ -155,6 +155,7 @@ module Homebrew
end
ohai "Downloading bottles for workflow: #{workflow}"
urls = GitHub.get_artifact_urls(workflow_run)
urls.each do |url|
GitHub.download_artifact(url, pr)

View File

@ -283,7 +283,7 @@ module GitHub
API.open_rest(url, data_binary_path: local_file, request_method: :POST, scopes: CREATE_ISSUE_FORK_OR_PR_SCOPES)
end
def self.get_workflow_run(user, repo, pull_request, workflow_id: "tests.yml", artifact_pattern: "bottles{,-*}")
def self.get_workflow_run(user, repo, pull_request, workflow_id: "tests.yml", artifact_pattern: "bottles{,_*}")
scopes = CREATE_ISSUE_FORK_OR_PR_SCOPES
# GraphQL unfortunately has no way to get the workflow yml name, so we need an extra REST call.