Skip to content

Commit

Permalink
Merge pull request #41 from fabi200123/linux-template-chown
Browse files Browse the repository at this point in the history
Move the chown from the Linux Template just for non-cached runners
  • Loading branch information
gabriel-samfira authored Dec 13, 2024
2 parents 15830ab + 1b97191 commit 6f970ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cloudconfig/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function downloadAndExtractRunner() {
mkdir -p "$RUN_HOME" || fail "failed to create actions-runner folder"
sendStatus "extracting runner"
tar xf "/home/{{ .RunnerUsername }}/{{ .FileName }}" -C "$RUN_HOME"/ || fail "failed to extract runner"
# chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R "$RUN_HOME"/ || fail "failed to change owner"
chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R "$RUN_HOME"/ || fail "failed to change owner"
}
if [ ! -d "$RUN_HOME" ];then
Expand Down Expand Up @@ -132,7 +132,8 @@ fi
sendStatus "enabling runner service"
cp "$RUN_HOME"/bin/runsvc.sh "$RUN_HOME"/ || fail "failed to copy runsvc.sh"
sudo chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R /home/{{ .RunnerUsername }} || fail "failed to change owner"
# Chown is not needed for the cached runner
# sudo chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R /home/{{ .RunnerUsername }} || fail "failed to change owner"
sudo systemctl daemon-reload || fail "failed to reload systemd"
sudo systemctl enable $SVC_NAME
{{- else}}
Expand Down

0 comments on commit 6f970ce

Please sign in to comment.