mirror of
https://code.forgejo.org/actions/setup-forgejo
synced 2025-03-14 22:27:01 +01:00
fix: LXC leftovers from the runner may belong to root
This commit is contained in:
parent
3897b689c2
commit
b425f1152e
2 changed files with 8 additions and 1 deletions
|
@ -5,6 +5,12 @@ set -e
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
function maybe_sudo() {
|
||||||
|
if test $(id -u) != 0; then
|
||||||
|
SUDO=sudo
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
: ${RETRY_DELAYS:=1 1 5 5 15 30}
|
: ${RETRY_DELAYS:=1 1 5 5 15 30}
|
||||||
|
|
||||||
function retry() {
|
function retry() {
|
||||||
|
|
|
@ -76,7 +76,8 @@ function setup() {
|
||||||
function teardown() {
|
function teardown() {
|
||||||
stop_daemon forgejo-runner $DIR
|
stop_daemon forgejo-runner $DIR
|
||||||
if test -f $DIR/forgejo-runner-home; then
|
if test -f $DIR/forgejo-runner-home; then
|
||||||
rm -fr $(cat $DIR/forgejo-runner-home)
|
maybe_sudo
|
||||||
|
$SUDO rm -fr $(cat $DIR/forgejo-runner-home)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue