@shetty4l/core 0.1.30 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shetty4l/core",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "Shared infrastructure primitives for Bun/TypeScript services",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,8 +46,15 @@ check_prereqs() {
46
46
 
47
47
  fetch_latest_release() {
48
48
  info "Fetching latest release from GitHub..."
49
+
50
+ local auth_header=()
51
+ if [ -n "${GITHUB_TOKEN:-}" ]; then
52
+ auth_header=(-H "Authorization: Bearer ${GITHUB_TOKEN}")
53
+ info "Using authenticated GitHub API request"
54
+ fi
55
+
49
56
  local release_json
50
- release_json=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest")
57
+ release_json=$(curl -fsSL "${auth_header[@]}" "https://api.github.com/repos/${REPO}/releases/latest")
51
58
 
52
59
  RELEASE_TAG=$(echo "$release_json" | jq -r '.tag_name')
53
60
  TARBALL_URL=$(echo "$release_json" | jq -r ".assets[] | select(.name | startswith(\"${SERVICE_NAME}-\")) | .browser_download_url")
@@ -74,10 +81,15 @@ download_and_extract() {
74
81
 
75
82
  mkdir -p "$version_dir"
76
83
 
84
+ local auth_header=()
85
+ if [ -n "${GITHUB_TOKEN:-}" ]; then
86
+ auth_header=(-H "Authorization: Bearer ${GITHUB_TOKEN}")
87
+ fi
88
+
77
89
  info "Downloading ${RELEASE_TAG}..."
78
90
  local tmpfile
79
91
  tmpfile=$(mktemp)
80
- curl -fsSL -o "$tmpfile" "$TARBALL_URL"
92
+ curl -fsSL "${auth_header[@]}" -o "$tmpfile" "$TARBALL_URL"
81
93
 
82
94
  info "Extracting to ${version_dir}..."
83
95
  tar xzf "$tmpfile" -C "$version_dir"