Fix CI: Prevent interactive prompts in sonar-analysis job
Some checks failed
CI / lint-and-test (push) Successful in 2m34s
CI / secret-scanning (push) Successful in 1m33s
CI / security-scan (push) Successful in 2m12s
CI / dependency-scan (push) Successful in 1m38s
CI / sast-scan (push) Successful in 2m36s
CI / container-scan (push) Successful in 2m14s
CI / sonar-analysis (push) Successful in 3m38s
CI / docker-build-test (push) Failing after 1m39s
CI / workflow-summary (push) Successful in 1m31s

ISSUE:
======
- CI job stuck waiting for tzdata timezone configuration
- Interactive prompt blocks non-interactive CI environment
- Job running for 30+ minutes waiting for user input

FIX:
====
- Set DEBIAN_FRONTEND=noninteractive in all apt-get steps
- Pre-configure timezone to UTC before package installation
- Prevents interactive prompts during package configuration

CHANGES:
========
- Install Node.js step: Added DEBIAN_FRONTEND=noninteractive
- Install Java step: Added DEBIAN_FRONTEND=noninteractive
- Install Python 3.11 step: Added DEBIAN_FRONTEND=noninteractive + TZ=UTC
- Set timezone symlink before apt-get install to avoid tzdata prompt

This ensures all package installations run non-interactively.
This commit is contained in:
ilia 2026-01-10 15:03:37 -05:00
parent 64f37ef393
commit ac193950dd

View File

@ -242,6 +242,7 @@ jobs:
steps:
- name: Install Node.js for checkout action
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install -y curl
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
@ -252,6 +253,7 @@ jobs:
- name: Install Java and SonarScanner
run: |
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install -y wget curl unzip openjdk-21-jre
# Use a known working version to avoid download issues
@ -346,6 +348,9 @@ jobs:
- name: Install Python 3.11 and dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
export TZ=UTC
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa