Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/patch-fix-copilot-cli-ownership.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions actions/setup/sh/install_copilot_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ VERSION="${1:-}"
INSTALLER_URL="https://raw.githubusercontent.com/github/copilot-cli/main/install.sh"
INSTALLER_TEMP="/tmp/copilot-install.sh"
MAX_ATTEMPTS=3
COPILOT_DIR="/home/runner/.copilot"

# Fix directory ownership before installation
# This is needed because a previous AWF run on the same runner may have used
# `sudo -E awf --enable-chroot ...`, which creates the .copilot directory with
# root ownership. The Copilot CLI (running as the runner user) then fails when
# trying to create subdirectories. See: https://github.com/github/gh-aw/issues/12066
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The issue reference in the comment points to https://github.com/github/gh-aw/issues/12066, but according to the PR description, this fix is for issue #13979. The comment should be updated to reference the correct issue number.

Suggested change
# trying to create subdirectories. See: https://github.com/github/gh-aw/issues/12066
# trying to create subdirectories. See: https://github.com/github/gh-aw/issues/13979

Copilot uses AI. Check for mistakes.
echo "Ensuring correct ownership of $COPILOT_DIR..."
mkdir -p "$COPILOT_DIR"
sudo chown -R runner:runner "$COPILOT_DIR"
Comment on lines +24 to +33
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The COPILOT_DIR path /home/runner/.copilot and the user:group runner:runner are hardcoded, which means this script will only work correctly in GitHub Actions hosted runners. If this script is ever used in self-hosted runners or different CI environments where the user is not runner, the chown command may fail or be incorrect. Consider using environment variables like $HOME/.copilot and $(whoami):$(whoami) for better portability, or at a minimum, document that this script is specifically designed for GitHub Actions hosted runners.

Copilot uses AI. Check for mistakes.

# Function to download installer with retry logic
download_installer_with_retry() {
Expand Down