From dd92ad8e1b8ea180533fe130e6930509b6790ae7 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Wed, 17 Apr 2024 05:52:11 +0800 Subject: [PATCH] Update default artifact pattern to avoid migration problems --- Library/Homebrew/dev-cmd/pr-pull.rb | 5 +++-- Library/Homebrew/utils/github.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 7bed63570f..5f1cafa3ca 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -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) diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index de01f007c6..a090cf87b3 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -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.