From 62bdac7286839cd25fa3667af1a9b71981927c99 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Tue, 9 Jul 2024 17:49:50 +0530 Subject: [PATCH] Fix chown perms for self-hosted runner issue Signed-off-by: Riddhesh Sanghvi --- main.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.sh b/main.sh index 72eafb8..f22480a 100755 --- a/main.sh +++ b/main.sh @@ -138,11 +138,12 @@ function setup_ssh_access() { function maybe_install_submodules() { - # Change directory ownership to container user due to issue https://github.com/actions/checkout/issues/760 - # This will be changed to www-data or similar on deployment by deployer. - chown -R root: "$GITHUB_WORKSPACE" # Check and update submodules if any if [[ -f "$GITHUB_WORKSPACE/.gitmodules" ]]; then + # Change directory ownership to container user due to issue https://github.com/actions/checkout/issues/760 + # This will be changed to www-data or similar on deployment by deployer. + chown -R :root "$GITHUB_WORKSPACE" + # add github's public key curl -sL https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >>/etc/ssh/known_hosts