1
0
Fork 0
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:
Earl Warren 2025-01-28 21:45:37 +01:00
parent 3897b689c2
commit b425f1152e
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 8 additions and 1 deletions

View file

@ -5,6 +5,12 @@ set -e
export DEBIAN_FRONTEND=noninteractive
function maybe_sudo() {
if test $(id -u) != 0; then
SUDO=sudo
fi
}
: ${RETRY_DELAYS:=1 1 5 5 15 30}
function retry() {

View file

@ -76,7 +76,8 @@ function setup() {
function teardown() {
stop_daemon forgejo-runner $DIR
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
}