refactor: replace hardcoded /opt/gh-aw paths with GH_AW_HOME constants (partial)#21422
refactor: replace hardcoded /opt/gh-aw paths with GH_AW_HOME constants (partial)#21422
Conversation
…aths (partial) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot keep working |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Hey A couple of things to close out before this can leave draft:
If you'd like a hand finishing up, you can assign this prompt to your coding agent:
|
|
see #21443 |
Hardcoded
/opt/gh-awpaths throughout the compiler prevent self-hosted runners from relocating the installation directory. This PR introduces typed constants and a helper to abstract all path references, allowing operators to override viaGH_AW_HOME.New abstractions (
pkg/workflow/setup_action_paths.go)GhAwHome${GH_AW_HOME}run:blocksGhAwHomeJSprocess.env.GH_AW_HOMErequire()expressionsGhAwHomeExpr${{ env.GH_AW_HOME }}env:blocksGhAwHomeExprDefault${{ env.GH_AW_HOME || '/opt/gh-aw' }}JsRequireGhAw(path)process.env.GH_AW_HOME + '/path'SetupActionDestinationupdated toGhAwHomeExpr + "/actions".pkg/constants/constants.goGhAwHomeDefault = "/opt/gh-aw"DefaultGhAwMountto\${GH_AW_HOME}:\${GH_AW_HOME}:ro(shell-expanded at runtime)Example replacement pattern
Status
~20 compiler files updated. Remaining:
notify_comment.go,compiler_main_job.go(GH_AW_HOME job-level env injection),compiler_yaml.go,cache.go,safe_jobs.go,maintenance_workflow.go,mcp_github_config.go, several others, JS.cjsfiles, test updates, and lock file recompilation.