Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

The install script fails in environments where api.github.com is blocked by MITM proxies (e.g., GitHub Copilot agent runtime, corporate networks), returning HTTP 403 on release API calls.

Changes

  • Removed API validation: Eliminated all GitHub API calls for version checking and validation
  • Default to "latest": When no version is specified, uses "latest" which leverages GitHub's /releases/latest/download/ URL pattern
  • No API access required: The "latest" URL pattern automatically redirects to the actual latest release without requiring API access
  • Simplified script: Removed validation flags and error handling for API failures
  • Documentation: Updated troubleshooting guide to reflect the simpler approach, removing manual installation instructions since the automated script now works in all environments
  • Tests: Updated tests to verify "latest" functionality and removal of validation logic

Usage

# Install latest version (works in restricted networks)
curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash

# Install specific version
curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | \
  bash -s -- v0.40.0

This approach works seamlessly in restricted network environments by using GitHub's release download redirects instead of API calls.

Original prompt

Investigate why the github copilot agent runtime is failing to the install.sh script.

$ cd /home/runner/work/aw-test-5/aw-test-5 && curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash
[INFO] Detected OS: Linux -> linux
[INFO] Detected architecture: x86_64 -> amd64
[INFO] Platform: linux-amd64
[INFO] No version specified, fetching latest release information from GitHub...
[INFO] Fetching release data (attempt 1/3)...
[WARNING] Fetch attempt 1 failed (exit code: 22). Retrying in 2s...
[INFO] Fetching release data (attempt 2/3)...
[WARNING] Fetch attempt 2 failed (exit code: 22). Retrying in 4s...
[INFO] Fetching release data (attempt 3/3)...
[ERROR] Failed to fetch release data after 3 attempts
[ERROR] Failed to fetch latest release information from GitHub API
[INFO] You can specify a version directly: ./install-gh-aw.sh v1.0.0
<exited with exit code 1>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 4, 2026 06:31
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate failure in install.sh script for Copilot agent Add --skip-validation flag for install script in restricted networks Feb 4, 2026
Copilot AI requested a review from pelikhan February 4, 2026 06:37
@pelikhan
Copy link
Contributor

pelikhan commented Feb 4, 2026

@copilot remove validation and use "latest" as the default version if not provided.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 4, 2026

@copilot remove validation and use "latest" as the default version if not provided.

Done in 6ba74bd. Removed all validation logic and the script now uses "latest" as the default version when none is specified. This uses GitHub's /releases/latest/download/ URL pattern which works without API access.

Copilot AI changed the title Add --skip-validation flag for install script in restricted networks Remove validation, use "latest" as default version for install script Feb 4, 2026
@pelikhan pelikhan marked this pull request as ready for review February 4, 2026 07:17
Copilot AI review requested due to automatic review settings February 4, 2026 07:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the installation flow for gh-aw to avoid using the GitHub Releases API (which can be blocked by MITM proxies) and instead rely on GitHub’s releases/latest/download redirect pattern, while keeping the CLI and GitHub Action installer behavior in sync. It also updates tests and documentation to match the new default of using "latest" when no version is specified.

Changes:

  • Simplified both install scripts to default to VERSION="latest" when no version is specified, and construct download/checksum URLs using the releases/latest/download pattern instead of querying the GitHub API.
  • Removed the release existence validation logic that depended on the GitHub API, while keeping the retry-capable fetch_release_data helper available for any future use.
  • Extended the install script tests to verify the new "latest" behavior and updated troubleshooting docs with guidance for restricted network environments and manual installation instructions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
install-gh-aw.sh Switches default behavior to use "latest" (with a log message), removes API-based version/validation logic, and constructs download/checksum URLs using releases/latest/download when VERSION=latest, aligning the script with environments where api.github.com is blocked.
actions/setup-cli/install.sh Mirrors the same "latest"-by-default and non-API URL construction logic used in install-gh-aw.sh, ensuring the GitHub Action’s installer behaves consistently and avoids api.github.com calls.
scripts/test-install-script.sh Adds a new test block to assert that the main install script uses "latest" by default, builds URLs with releases/latest/download, and no longer contains API validation logic, guarding the new behavior.
docs/src/content/docs/troubleshooting/common-issues.md Documents the new "latest"-based installation flow, explains why it works in restricted environments, and provides explicit examples for installing specific versions and manual binary installation using the new URL scheme.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan February 4, 2026 07:31
@pelikhan pelikhan merged commit 1c8f6b6 into main Feb 4, 2026
124 of 126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants