Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 01c1223

Browse files
trlyampcode-com
andcommitted
Enable public installer access via GitHub Releases
- Add GitHub authentication checks before repository cloning - Provide clear authentication guidance (GitHub CLI, SSH, PAT) - Improve error handling with specific solutions - Update README to use GitHub Releases URL for public access - Add GitHub Actions workflow for automatic release updates Benefits: - install.sh publicly accessible even from private repository - Clear guidance for GitHub authentication at appropriate time - Better error messages with actionable next steps - Automated release management URL: https://github.com/sourcegraph/revenue/releases/latest/download/install.sh Amp-Thread-ID: https://ampcode.com/threads/T-cb412e56-498f-4296-8b89-e1346b829f41 Co-authored-by: Amp <amp@ampcode.com>
1 parent 1d4658b commit 01c1223

File tree

3 files changed

+115
-2
lines changed

3 files changed

+115
-2
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release Installer
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths: [ 'install.sh' ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Get short commit SHA
20+
id: vars
21+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
22+
23+
- name: Create or update release
24+
uses: softprops/action-gh-release@v1
25+
with:
26+
tag_name: latest
27+
name: Latest Installer
28+
body: |
29+
🚀 **Revenue Team Workstation Installer**
30+
31+
Public installer for the Sourcegraph Revenue team workstation setup.
32+
33+
**Usage:**
34+
```bash
35+
/bin/bash -c "$(curl -fsSL https://github.com/sourcegraph/revenue/releases/latest/download/install.sh)"
36+
```
37+
38+
**What it does:**
39+
- Sets up macOS development environment
40+
- Installs VS Code, Python, Java, and other tools
41+
- Configures demo applications
42+
- Creates global `revenue` command
43+
44+
**Requirements:**
45+
- macOS (10.15+)
46+
- GitHub access to sourcegraph/revenue repository
47+
48+
Updated from commit: ${{ steps.vars.outputs.sha_short }}
49+
files: |
50+
install.sh
51+
prerelease: false
52+
make_latest: true
53+
generate_release_notes: false
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Complete macOS workstation setup for Revenue team members. Installs all tools ne
77
**Copy and paste this command into Terminal:**
88

99
```bash
10-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/sourcegraph/revenue/main/install.sh)"
10+
/bin/bash -c "$(curl -fsSL https://github.com/sourcegraph/revenue/releases/latest/download/install.sh)"
1111
```
1212

1313
**That's it!** The installer will:

install.sh

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,49 @@ check_git() {
6363
print_success "Git is available"
6464
}
6565

66+
# Check GitHub authentication
67+
check_github_access() {
68+
local repo_url="https://github.com/sourcegraph/revenue.git"
69+
local test_url="https://api.github.com/repos/sourcegraph/revenue"
70+
71+
print_info "Checking GitHub access to private repository..."
72+
73+
# First, try to access the repository API to check authentication
74+
if curl -s -f -H "Authorization: token $(git config --get github.token 2>/dev/null || echo '')" "$test_url" >/dev/null 2>&1; then
75+
print_success "GitHub access confirmed"
76+
return 0
77+
fi
78+
79+
# If that fails, try a simple git ls-remote to test access
80+
if git ls-remote "$repo_url" >/dev/null 2>&1; then
81+
print_success "GitHub access confirmed"
82+
return 0
83+
fi
84+
85+
# No access - provide authentication guidance
86+
print_warning "GitHub authentication required for private repository access"
87+
echo ""
88+
print_info "Please choose one of these authentication methods:"
89+
echo ""
90+
echo "1. 📱 GitHub CLI (Recommended):"
91+
print_info " Install: brew install gh"
92+
print_info " Login: gh auth login"
93+
echo ""
94+
echo "2. 🔐 SSH Key:"
95+
print_info " Generate: ssh-keygen -t ed25519 -C \"your_email@example.com\""
96+
print_info " Add to GitHub: https://github.com/settings/keys"
97+
echo ""
98+
echo "3. 🌐 Personal Access Token:"
99+
print_info " Create: https://github.com/settings/tokens"
100+
print_info " Configure: git config --global github.token YOUR_TOKEN"
101+
echo ""
102+
print_info "After authentication, run this installer again."
103+
print_info "Need repository access? Ask in #ask-tech-ops"
104+
echo ""
105+
106+
return 1
107+
}
108+
66109
# Clone or update the repository
67110
setup_repository() {
68111
repo_dir="$HOME/revenue" # Make repo_dir global for use by other functions
@@ -99,7 +142,16 @@ setup_repository() {
99142
cd "$repo_dir"
100143
else
101144
print_error "Failed to clone repository"
102-
print_info "Please check your internet connection and GitHub access"
145+
print_info "This might indicate:"
146+
print_info " • Network connectivity issues"
147+
print_info " • GitHub authentication problems"
148+
print_info " • Missing repository access permissions"
149+
echo ""
150+
print_info "Solutions:"
151+
print_info " • Check your internet connection"
152+
print_info " • Verify GitHub authentication: gh auth status"
153+
print_info " • Request repository access in #ask-tech-ops"
154+
echo ""
103155
exit 1
104156
fi
105157
fi
@@ -325,6 +377,12 @@ main() {
325377
print_header
326378
check_macos
327379
check_git
380+
381+
# Check GitHub access before attempting to clone
382+
if ! check_github_access; then
383+
exit 1
384+
fi
385+
328386
setup_repository
329387
run_installer
330388

0 commit comments

Comments
 (0)