Skip to content

Commit ada84f0

Browse files
CopilotMossakagithub-actions[bot]
authored
fix: ensure /home/runner/.copilot directory has correct ownership before Copilot CLI install (#13980)
* Initial plan * fix: ensure /home/runner/.copilot directory has correct ownership before Copilot CLI install Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> * Add changeset [skip-ci] --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> Co-authored-by: Jiaxiao Zhou <duibao55328@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 5b23fd0 commit ada84f0

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

.changeset/patch-fix-copilot-cli-ownership.md

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/setup/sh/install_copilot_cli.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ VERSION="${1:-}"
2121
INSTALLER_URL="https://raw.githubusercontent.com/github/copilot-cli/main/install.sh"
2222
INSTALLER_TEMP="/tmp/copilot-install.sh"
2323
MAX_ATTEMPTS=3
24+
COPILOT_DIR="/home/runner/.copilot"
25+
26+
# Fix directory ownership before installation
27+
# This is needed because a previous AWF run on the same runner may have used
28+
# `sudo -E awf --enable-chroot ...`, which creates the .copilot directory with
29+
# root ownership. The Copilot CLI (running as the runner user) then fails when
30+
# trying to create subdirectories. See: https://github.com/github/gh-aw/issues/12066
31+
echo "Ensuring correct ownership of $COPILOT_DIR..."
32+
mkdir -p "$COPILOT_DIR"
33+
sudo chown -R runner:runner "$COPILOT_DIR"
2434

2535
# Function to download installer with retry logic
2636
download_installer_with_retry() {

0 commit comments

Comments
 (0)