Skip to content

Propagate $GITHUB_PATH into chroot PATH for setup-* action support#1359

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-tools-visibility-in-chroot
Draft

Propagate $GITHUB_PATH into chroot PATH for setup-* action support#1359
Copilot wants to merge 3 commits intomainfrom
copilot/fix-tools-visibility-in-chroot

Conversation

Copy link
Contributor

Copilot AI commented Mar 18, 2026

Tools installed by pre-AWF setup steps (setup-ruby, setup-dart, etc.) aren't visible inside the chroot because $GITHUB_PATH entries may be lost when sudo resets PATH, and the fallback PATH only hardcoded Node/Python/Go from hostedtoolcache.

Note: /opt/hostedtoolcache is already bind-mounted (/opt:/host/opt:ro) — the binaries exist on disk, they're just not in PATH.

src/docker-manager.ts

  • readGitHubPathEntries() — reads the $GITHUB_PATH file written by setup-* actions
  • mergeGitHubPathEntries() — prepends those entries into PATH with deduplication
  • AWF_HOST_PATH now merges $GITHUB_PATH file contents with process.env.PATH
if (process.env.PATH) {
  const githubPathEntries = readGitHubPathEntries();
  environment.AWF_HOST_PATH = mergeGitHubPathEntries(process.env.PATH, githubPathEntries);
}

containers/agent/entrypoint.sh

  • Fallback PATH (when AWF_HOST_PATH is unset) now dynamically scans all /opt/hostedtoolcache/*/ tool directories instead of hardcoding only three tools

Tests

  • 14 new unit tests covering readGitHubPathEntries, mergeGitHubPathEntries, and generateDockerCompose integration with $GITHUB_PATH

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 18, 2026 19:31
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix tools installed by pre-AWF setup steps visibility in chroot Propagate $GITHUB_PATH into chroot PATH for setup-* action support Mar 18, 2026
Copilot AI requested a review from Mossaka March 18, 2026 19:34
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.

Tools installed by pre-AWF setup steps (setup-ruby, setup-dart) may not be visible in chroot

2 participants