Add CI job to test install-gh-aw.sh with stable release#23633
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/fa4cec49-d5e9-4494-a89a-acee17e3d7a5 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/fa4cec49-d5e9-4494-a89a-acee17e3d7a5 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds CI coverage to validate the install script against the stable release, and updates the setup action’s copied install script to default to stable with alias resolution via releases.json.
Changes:
- Add an
install-scriptCI job that validates thestablealias, runsinstall-gh-aw.sh stable, and verifies the installed binary version. - Update
actions/setup-cli/install.shto default tostableand resolve version aliases from.github/aw/releases.jsonbefore download. - Extend CI path filters so changes to
install-gh-aw.shtrigger the workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
actions/setup-cli/install.sh |
Switch default version to stable and add alias resolution from releases.json prior to download. |
.github/workflows/ci.yml |
Add install-script job to validate stable and run the install script in CI; include install-gh-aw.sh in path triggers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [ -n "$releases_json" ]; then | ||
| resolved_version="" | ||
| if [ "$HAS_JQ" = true ]; then | ||
| resolved_version=$(echo "$releases_json" | jq -r ".aliases[\"$VERSION\"] // empty" 2>/dev/null) || { |
There was a problem hiding this comment.
The jq alias lookup is built by string-interpolating $VERSION into the jq program (".aliases["$VERSION"]"), which can break for versions containing quotes/backslashes and makes the parsing behavior depend on shell escaping. Use jq's --arg to pass the key instead (e.g., look up .aliases[$ver]) so alias resolution is robust for any valid input.
| resolved_version=$(echo "$releases_json" | jq -r ".aliases[\"$VERSION\"] // empty" 2>/dev/null) || { | |
| resolved_version=$(echo "$releases_json" | jq -r --arg ver "$VERSION" '.aliases[$ver] // empty' 2>/dev/null) || { |
| print_info "Resolving version alias '$VERSION' from $RELEASES_JSON_URL..." | ||
|
|
||
| releases_json="" | ||
| releases_json=$(curl -s -f "$RELEASES_JSON_URL" 2>/dev/null) || true |
There was a problem hiding this comment.
Alias resolution fetches releases.json via a single curl call (no retry/backoff), even though the script already has fetch_release_data() with retry logic. Consider reusing fetch_release_data for RELEASES_JSON_URL to reduce flaky installs/CI failures due to transient network errors.
| releases_json=$(curl -s -f "$RELEASES_JSON_URL" 2>/dev/null) || true | |
| releases_json=$(fetch_release_data "$RELEASES_JSON_URL") || true |
| echo "✅ 'stable' alias resolves to a valid version: $STABLE" | ||
|
|
||
| - name: Run install-gh-aw.sh with stable version | ||
| run: bash install-gh-aw.sh stable |
There was a problem hiding this comment.
This job validates stable using the checked-out .github/aw/releases.json, but install-gh-aw.sh stable resolves aliases by fetching .../main/.github/aw/releases.json. If a PR updates releases.json (or tests a fork), the expected version can diverge from what the install script actually installs, causing false failures and not testing the PR's updated stable. Consider making the install step use the same releases.json source (e.g., pass the resolved version to the script, or allow the script/workflow to point alias resolution at the checked-out file or the current commit SHA).
| run: bash install-gh-aw.sh stable | |
| run: bash install-gh-aw.sh "${{ steps.validate-stable.outputs.stable_version }}" |
| # If no version is specified, it will use "stable" (resolved from .github/aw/releases.json) | ||
| # Version aliases (e.g. "stable", "latest") are resolved via .github/aw/releases.json before download. | ||
| # Note: Checksum validation is currently skipped by default (will be enabled in future releases) | ||
| # | ||
| # Examples: | ||
| # ./install-gh-aw.sh # Install latest version | ||
| # ./install-gh-aw.sh # Install stable version | ||
| # ./install-gh-aw.sh latest # Install latest version |
There was a problem hiding this comment.
PR title/description focus on adding a CI job, but this change also updates the install script’s default behavior from latest to stable and introduces alias resolution. If intentional, please reflect this in the PR description (or split into a separate PR) so reviewers understand the behavior change.
Summary
Adds a CI job (
install-script) that validatesinstall-gh-aw.shworks correctly and thatstableis a valid, downloadable release.Changes
install-gh-aw.shto the CIpathstrigger so the job runs when the install script changesinstall-scriptCI job with three steps:.github/aw/releases.jsonand asserts thestablealias is a propervMAJOR.MINOR.PATCHsemver (not missing, not self-referential)stableas the requested version, which downloads the binary from GitHub Releasesversion, and checks the installed version matches whatreleases.jsonresolvedstabletoThis catches issues like:
stablealias not being set or pointing to an invalid version