Skip to content

Commit

Permalink
Update default artifact pattern to avoid migration problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongRuoyu committed Apr 16, 2024
1 parent d6d1b7d commit dd92ad8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Library/Homebrew/dev-cmd/pr-pull.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class PrPull < AbstractCommand
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=",
Expand All @@ -81,7 +81,7 @@ def run
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?

Expand Down Expand Up @@ -155,6 +155,7 @@ def run
end

ohai "Downloading bottles for workflow: #{workflow}"

urls = GitHub.get_artifact_urls(workflow_run)
urls.each do |url|
GitHub.download_artifact(url, pr)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def self.upload_release_asset(user, repo, id, local_file: nil, remote_file: nil)
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.
Expand Down

0 comments on commit dd92ad8

Please sign in to comment.