refactor: replace hardcoded /opt/gh-aw/ paths with GhAwHome constants#20864
refactor: replace hardcoded /opt/gh-aw/ paths with GhAwHome constants#20864
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready. |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
Commit pushed:
|
Agent Container Tool Check
Result: 12/12 tools available ✅ Overall Status: PASS
|
|
Smoke test (Codex) results:
Warning
|
|
Smoke Test 23071512641 —
Overall: ✅ PASS
|
There was a problem hiding this comment.
LGTM! The refactoring cleanly replaces hardcoded /opt/gh-aw/ paths with GH_AW_HOME-derived constants. The fallback ${GH_AW_HOME:-/opt/gh-aw} ensures backward compatibility.
📰 BREAKING: Report filed by Smoke Copilot
|
|
||
| # Derive GH_AW_HOME from DESTINATION (strip /actions suffix) | ||
| # This allows setup.sh to be used with custom base directories | ||
| GH_AW_HOME="${DESTINATION%/actions}" |
There was a problem hiding this comment.
Nice use of parameter expansion \$\{DESTINATION%/actions} to derive GH_AW_HOME. This cleanly strips the /actions suffix and avoids hardcoding /opt/gh-aw everywhere.
| copilot) | ||
| echo "Using Copilot converter..." | ||
| bash /opt/gh-aw/actions/convert_gateway_config_copilot.sh | ||
| bash ${GH_AW_HOME:-/opt/gh-aw}/actions/convert_gateway_config_copilot.sh |
There was a problem hiding this comment.
Good use of \$\{GH_AW_HOME:-/opt/gh-aw} default fallback — ensures backward compatibility if GH_AW_HOME isn't set in older environments.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Smoke Test Results — Run §23071512648Overall: PARTIAL (2 skipped, rest passed)
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
| } | ||
|
|
||
| # Get destination from input or use default | ||
| DESTINATION="${INPUT_DESTINATION:-/opt/gh-aw/actions}" |
There was a problem hiding this comment.
Good improvement - using mkdir -p first and only falling back to sudo when needed. This is more portable across Linux environments where /opt may or may not require elevated permissions.
| copilot) | ||
| echo "Using Copilot converter..." | ||
| bash /opt/gh-aw/actions/convert_gateway_config_copilot.sh | ||
| bash ${GH_AW_HOME:-/opt/gh-aw}/actions/convert_gateway_config_copilot.sh |
There was a problem hiding this comment.
Using \$\{GH_AW_HOME:-/opt/gh-aw} with a fallback default is a solid approach — maintains backward compatibility while supporting custom install paths.
|
@copilot recompile |
…ride, JS require() fixes Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed all review comments in b0a4edd:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot merge main, recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Merged main and recompiled all 173 workflow lock files in e1eddb9. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
| "gh-aw": patch | ||
| --- | ||
|
|
||
| Replaced hardcoded `/opt/gh-aw/` paths with shared `GhAwHome` constants and `GH_AW_HOME`-based path resolution across setup scripts and workflow compilation. |
There was a problem hiding this comment.
Good changeset note! Concise and clear about what changed.
| "gh-aw": patch | ||
| --- | ||
|
|
||
| Add gh CLI configuration script for GitHub Enterprise support. Workflows can now source `configure_gh_for_ghe.sh` before running `gh` commands to automatically detect and configure the correct GitHub Enterprise host from environment variables (`GITHUB_SERVER_URL`, `GITHUB_ENTERPRISE_HOST`, `GITHUB_HOST`, or `GH_HOST`). This fixes the "none of the git remotes configured for this repository point to a known GitHub host" error when running workflows like repo-assist on GHE domains. |
There was a problem hiding this comment.
Good description of the GHES fix. Clear problem statement and resolution.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Hey Recommendation: Split into two focused PRs:
This keeps each PR reviewable on its own merits and makes the git history easier to bisect. The 27K-line diff across 282 files (mostly recompiled lock files) makes this hard to review as-is. Splitting would also reduce risk — the GHE script can be validated independently without holding up the path refactor. 🙏
|
Refactors workflow compilation and setup scripts to eliminate hardcoded
/opt/gh-awpaths, enabling self-hosted runners to relocate the installation viaGH_AW_HOME.Changes Made
New Constants & Helpers (
pkg/workflow/setup_action_paths.go)GhAwHome(shell),GhAwHomeJS(JavaScript),GhAwHomeExpr(GHA expression),GhAwHomeExprDefault(${{ env.GH_AW_HOME || '/opt/gh-aw' }}) constantsSetupActionDestinationto useGhAwHomeExpr + "/actions"so GitHub Actions resolves it before passing to shellJsRequireGhAw()helper for Node.jsrequire()pathsConstants (
pkg/constants/constants.go)GhAwHomeDefaultDefaultGhAwMountto use${GH_AW_HOME}without:-fallback (job env always sets it)Setup Scripts
actions/setup/setup.sh: Added trailing slash normalization before derivingGH_AW_HOME; exports to$GITHUB_ENVactions/setup/sh/*.sh: Quoted all${GH_AW_HOME:-/opt/gh-aw}expansions to prevent word-splittingWorkflow Compiler
compiler_yaml_helpers.go: RestoredINPUT_DESTINATIONin script mode anddestination:in dev/release mode usingSetupActionDestinationcompiler_safe_outputs_steps.go,compiler_safe_outputs_specialized.go,maintenance_workflow.go,compiler_workflow_call.go: Replaced allrequire('/opt/gh-aw/...')withJsRequireGhAw()compiler_main_job.go,compiler_safe_outputs_job.go,repo_memory.go,notify_comment.go: Job-levelGH_AW_HOMEusesGhAwHomeExprDefaultso callers can override via workflow/repo envcompiler_main_job.go: RestoredGH_AW_SAFE_OUTPUTS*paths as job-level env vars usingGhAwHomeExprTests & Compiled Outputs
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
✨ PR Review Safe Output Test - Run 23071512648
✨ PR Review Safe Output Test - Run 23088152922
✨ PR Review Safe Output Test - Run 23100193159