diff --git a/scripts/auto-deploy.sh b/scripts/auto-deploy.sh index e6d3b31..19e2313 100755 --- a/scripts/auto-deploy.sh +++ b/scripts/auto-deploy.sh @@ -37,9 +37,9 @@ warning() { echo -e "${YELLOW}[WARNING]${NC} $1" | tee -a "$LOG_FILE" } -# Check if running as root -if [[ $EUID -eq 0 ]]; then - error "This script should not be run as root" +# Check if running as root (skip in CI environments) +if [[ $EUID -eq 0 ]] && [[ -z "$CI" ]]; then + error "This script should not be run as root (use CI=true to override)" exit 1 fi diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 0e3221e..cde6d1c 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -36,9 +36,9 @@ warning() { echo -e "${YELLOW}[WARNING]${NC} $1" } -# Check if running as root -if [[ $EUID -eq 0 ]]; then - error "This script should not be run as root" +# Check if running as root (skip in CI environments) +if [[ $EUID -eq 0 ]] && [[ -z "$CI" ]]; then + error "This script should not be run as root (use CI=true to override)" exit 1 fi diff --git a/scripts/gitea-deploy-simple.sh b/scripts/gitea-deploy-simple.sh index a8577d6..f160bdb 100755 --- a/scripts/gitea-deploy-simple.sh +++ b/scripts/gitea-deploy-simple.sh @@ -37,9 +37,9 @@ warning() { echo -e "${YELLOW}[WARNING]${NC} $1" | tee -a "$LOG_FILE" } -# Check if running as root -if [[ $EUID -eq 0 ]]; then - error "This script should not be run as root" +# Check if running as root (skip in CI environments) +if [[ $EUID -eq 0 ]] && [[ -z "$CI" ]]; then + error "This script should not be run as root (use CI=true to override)" exit 1 fi diff --git a/scripts/gitea-deploy.sh b/scripts/gitea-deploy.sh index 2db54e6..9aac747 100755 --- a/scripts/gitea-deploy.sh +++ b/scripts/gitea-deploy.sh @@ -37,9 +37,9 @@ warning() { echo -e "${YELLOW}[WARNING]${NC} $1" | tee -a "$LOG_FILE" } -# Check if running as root -if [[ $EUID -eq 0 ]]; then - error "This script should not be run as root" +# Check if running as root (skip in CI environments) +if [[ $EUID -eq 0 ]] && [[ -z "$CI" ]]; then + error "This script should not be run as root (use CI=true to override)" exit 1 fi diff --git a/scripts/setup-gitea-runner.sh b/scripts/setup-gitea-runner.sh index 37148e0..418655d 100755 --- a/scripts/setup-gitea-runner.sh +++ b/scripts/setup-gitea-runner.sh @@ -35,9 +35,9 @@ warning() { echo -e "${YELLOW}[WARNING]${NC} $1" } -# Check if running as root -if [[ $EUID -eq 0 ]]; then - error "This script should not be run as root" +# Check if running as root (skip in CI environments) +if [[ $EUID -eq 0 ]] && [[ -z "$CI" ]]; then + error "This script should not be run as root (use CI=true to override)" exit 1 fi