I am trying to setup a brew formula to download packages from private github behind sso, but getting error while downloading. Following is the formula:
class MyMvn < Formula
desc "CLI tool to do maven operations"
homepage "https://github.my.company/myorg/my-mvn"
version "1.2.6"
on_macos do
if Hardware::CPU.arm?
url "https://github.my.company/myorg/my-mvn/releases/download/v1.2.6/my-mvn_1.2.6_Darwin_x86_64.tar.gz"
sha256 "d23869c3248d35d51d0b7eded53c93ebb16b9c213fa1cf9b8f736e851f8985dd"
if Hardware::CPU.intel?
url "https://github.my.company/myorg/my-mvn/releases/download/v1.2.6/my-mvn_1.2.6_Darwin_x86_64.tar.gz"
sha256 "d23869c3248d35d51d0b7eded53c93ebb16b9c213fa1cf9b8f736e851f8985dd"
def install
bin.install "my-mvn"
end
end
end
depends_on "maven"
test do
system "#{bin}/my-mvn help"
end
end
And download is being redirected to login which would result into SHA mismatch:
Downloading from https://github.my.company/login?return_to=https%3A%2F%2Fgithub.my.company%2Fmyorg%2Fmy-mvn%2Freleases%2Fdownload%2Fv1.2.6%2Fmy-mvn_1.2.6_Darwin_x86_64.tar.gz
---
---
Error: my-mvn: SHA256 mismatch
Is there any straight forward way to solve this, without custom homebrew downloader? Also an example of custom downloader for this case would be great. Thanks.