mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2025-02-23 00:11:10 -05:00
Merge pull request 'fix: LXC leftovers from the runner may belong to root' (#297) from earl-warren/setup-forgejo:wip-cleanup into main
Reviewed-on: https://code.forgejo.org/actions/setup-forgejo/pulls/297
This commit is contained in:
commit
f1a77d50d5
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