A small universal script to download and run any asset from a private GitHub repository.
Ideal as an entrypoint to automatically install your autoinstall.sh or other setup scripts.
- Works with any private GitHub repository
- Automatic resume for downloads (
curl -C -) - Idempotent: can be run multiple times without issues
- No PAT included in the script β safe
- Works whether the downloaded asset needs to:
- execute local Linux commands
- download additional private assets
bashcurl- Internet access
- A GitHub PAT (Personal Access Token) with read permissions for the private repository
Run the script without saving it locally, providing all required parameters:
PAT=YOUR_PAT \
USER=USERNAME \
REPO=REPO_NAME \
TAG=TAG_NAME \
FILE=FILE_TO_DOWNLOAD_AND_EXECUTE.sh \
WORKDIR=directory/to/save/files \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/AleDetto/gh-private-bootstrap/main/bootstrap.sh)"- The bootstrap.sh script downloads and executes the specified file directly in memory.
- WORKDIR is optional; if omitted, a default temporary folder will be used.
- The downloaded asset (FILE) can either run local commands or download additional assets as needed because it will inherit all the ENV vars declared for bootstrap.sh.
Here's an example of the terminal output when running the bootstrap + test install script:

