Skip to content

Commit 2b84134

Browse files
authored
Merge pull request #3 from scaleapi/RF/remove-auth-from-formula
formula: use public download URL instead of API URL with auth
2 parents a34fbcb + b967fee commit 2b84134

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

.github/workflows/publish-release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@ jobs:
5757
# Compute SHA256 for the macOS binary
5858
SHA_DARWIN_ARM64=$(sha256sum artifacts/sgpctl-darwin-arm64 | awk '{print $1}')
5959
60-
# Get the asset ID for the macOS binary
61-
ASSET_ID=$(gh api "repos/${{ github.repository }}/releases/tags/${TAG}" --jq '.assets[] | select(.name=="sgpctl-darwin-arm64") | .id')
62-
6360
# Update formula
64-
sed -i "s|releases/assets/[0-9]*|releases/assets/${ASSET_ID}|" Formula/sgpctl.rb
61+
sed -i "s|releases/download/v[^/]*/|releases/download/${TAG}/|" Formula/sgpctl.rb
6562
sed -i "s/version \".*\"/version \"${VERSION}\"/" Formula/sgpctl.rb
6663
sed -i "s/sha256 \".*\"/sha256 \"${SHA_DARWIN_ARM64}\"/" Formula/sgpctl.rb
6764

Formula/sgpctl.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
class Sgpctl < Formula
22
desc "CLI tool for managing SGP services"
33
homepage "https://github.com/scaleapi/sgpctl"
4-
url "https://api.github.com/repos/scaleapi/sgpctl/releases/assets/366283429",
5-
headers: [
6-
"Accept: application/octet-stream",
7-
"X-GitHub-Api-Version: 2022-11-28",
8-
"Authorization: bearer #{ENV.fetch("HOMEBREW_GITHUB_API_TOKEN")}",
9-
]
4+
url "https://github.com/scaleapi/sgpctl/releases/download/v0.0.1/sgpctl-darwin-arm64"
105
version "0.0.1"
116
sha256 "528ef19cfe50e69791a5f7d09bd6cc1466ea3b0d29801acdcde05a1d55bb2ea9"
127

0 commit comments

Comments
 (0)