Skip to content

Commit

Permalink
ci-upload: don't upload if root_url is a GitHub Releases url
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Aug 24, 2020
1 parent 7cb8a23 commit c31ecec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/test_ci_upload.rb
Expand Up @@ -37,6 +37,16 @@ def run!(tap, args:)
hash.deep_merge(JSON.parse(IO.read(json_file)))
end

bottles_hash.each do |_, bottle_hash|
root_url = bottle_hash["bottle"]["root_url"]
url_match = root_url.match HOMEBREW_RELEASES_URL_REGEX
_, user, repo, tag = *url_match

next unless tag

odie "Cowardly refusing to upload to GitHub Releases, use `brew pr-upload`."
end

if args.dry_run?
bottles_hash = {
"testbottest" => {
Expand Down

0 comments on commit c31ecec

Please sign in to comment.