Skip to content

fix(gh-aw): preserve Squad CLI install contract - #1887

Merged
bradygaster merged 2 commits into
devfrom
bradygaster-fix-squad-action-install
Aug 26, 2026
Merged

fix(gh-aw): preserve Squad CLI install contract#1887
bradygaster merged 2 commits into
devfrom
bradygaster-fix-squad-action-install

Conversation

@bradygaster

Copy link
Copy Markdown
Owner

Summary

  • install the selected Squad CLI once with npm install --global in a runner-temporary prefix so package postinstall patches always execute
  • bind SQUAD_CLI_VERSION on the install step so gh-aw compilation preserves the selected version
  • default only to the currently published stable CLI (0.12.0) and capability-gate squad health until the release containing it is published
  • add source and compiled-output regression coverage for the failure observed in ReadR run 32900470947

Closes #1884

Validation

  • node node_modules\vitest\vitest.mjs run test/squad-cli-pin.test.ts test/gh-aw-quality.test.ts -t '#1884' — 3 passed
  • node node_modules\vitest\vitest.mjs run test/squad-cli-pin.test.ts — 11 passed
  • gh aw compile squad squad-implement-worker squad-deps-worker --strict --approve --no-check-update in the downstream .github/workflows layout — 3 compiled successfully; compiled lock inspection confirmed the version binding and global install command
  • SKIP_BUILD_BUMP=1 npm run build — passed for SDK and CLI
  • isolated npm install --global --prefix <temp> @bradygaster/squad-cli@0.12.0 — installed 0.12.0 and confirmed the compatibility path is required because that published release does not expose health

Release dependency

The full readiness gate activates automatically once a stable CLI containing squad health is published and the existing release automation advances the activation pin. Until then, activation uses the published 0.12.0 global install, emits an explicit warning, and continues instead of failing on an unavailable command.

No changeset is required because this PR does not modify packages/squad-cli/src/ or packages/squad-sdk/src/.

Security review

No secrets, actions, permissions, or redirect targets were added or removed. The existing GitHub token expressions are unchanged. The repository-controlled version value is passed through a quoted environment expansion into a fixed npm package name, and the global installation is scoped to $RUNNER_TEMP rather than a system-wide prefix.

Closes #1884

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 220886ad-9f6f-4397-82da-1b5a56822601
Copilot AI lite review requested due to automatic review settings August 25, 2026 23:50
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1887

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 4
Files added 0
Files modified 4
Files deleted 0
Modules touched 3

🎯 Risk Factors

  • 4 files changed (≤5 → LOW)
  • 3 modules touched (2-4 → MEDIUM)

📦 Modules Affected

docs (1 file)
  • docs/src/content/docs/guide/gh-aw.md
root (1 file)
  • workflows/shared/squad.md
tests (2 files)
  • test/gh-aw-quality.test.ts
  • test/squad-cli-pin.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 6b1aa93

PR Scope: 🔧 Infrastructure

⚠️ 3 item(s) to address before review

Status Check Details
Single commit 2 commits — consider squashing before review
Not in draft Ready for review
Branch up to date Up to date with dev
Copilot review No Copilot review yet — it may still be processing
Changeset present No source files changed — changeset not required
Scope clean No .squad/ or docs/proposals/ files
No merge conflicts No merge conflicts
Copilot threads resolved 1 unresolved Copilot thread(s) — fix and resolve before merging
CI passing All checks passing

Files Changed (4 files, +89 −24)

File +/−
docs/src/content/docs/guide/gh-aw.md +1 −1
test/gh-aw-quality.test.ts +35 −5
test/squad-cli-pin.test.ts +24 −6
workflows/shared/squad.md +29 −12

Total: +89 −24


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The current health gating check can silently treat “squad not found / help failed” as “health unsupported” and proceed, which can mask real bootstrap failures in CI.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the gh-aw shared Squad bootstrap to preserve the selected Squad CLI version through compilation by installing the CLI once via npm install --global --prefix $RUNNER_TEMP/..., binding SQUAD_CLI_VERSION at the step level, and gating squad health until a published release containing that command is available. It also adds regression tests covering both the source shared component and the compiled lock output, plus updates docs for the new default pin.

Changes:

  • Install Squad CLI once in activation pre-steps via npm install --global --prefix "$RUNNER_TEMP/..." and add its bin dir to GITHUB_PATH.
  • Bind SQUAD_CLI_VERSION on the install step (instead of job-level env) so gh-aw compilation preserves it; switch init/health to use the installed squad binary.
  • Add regression tests verifying the compiled workflow retains the version binding and install contract; update docs default pin to 0.12.0.
File summaries
File Description
workflows/shared/squad.md Moves CLI version binding to step env, installs the CLI globally under $RUNNER_TEMP, and gates squad health until supported.
test/squad-cli-pin.test.ts Adds assertions ensuring the install step binds SQUAD_CLI_VERSION and the source no longer uses npx-based invocation.
test/gh-aw-quality.test.ts Adds compiled-output regression coverage for preserved version binding and install contract; updates health/init expectations for global install.
docs/src/content/docs/guide/gh-aw.md Updates documented default SQUAD_CLI_VERSION to 0.12.0.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread workflows/shared/squad.md
Comment on lines +123 to +127
set -euo pipefail
if squad help | grep -Fq 'Validate team state for CI'; then
squad health --json
else
echo "::warning::Squad CLI ${SQUAD_CLI_VERSION} predates the health command; the readiness gate will activate after the next published CLI pin."
@bradygaster
bradygaster merged commit 2fa4c25 into dev Aug 26, 2026
18 checks passed
shantanusharma pushed a commit to shantanusharma/squad that referenced this pull request Aug 26, 2026
…all fixes

Complete the 0.13.0 release notes to cover:
- The gh-aw install contract fix (bradygaster#1887) and full hardening wave
- squad-deps-worker new dependency manifest worker
- Activation pin drift guard and auto-update on release
- All workflow router, dispatch, and planning lifecycle fixes
- CLI: squad health, watch stop signals, externalized state, archival, CRLF
- SDK: scheduler Windows paths, FSStorageProvider rootDir, ADO URL decode

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bradygaster
bradygaster deleted the bradygaster-fix-squad-action-install branch September 9, 2026 19:44
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.

Preserve Squad CLI version in compiled action workflows

2 participants