diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index da14bd83..e1bcbbe4 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -17,6 +17,9 @@ jobs: - name: Set up Docker Compose run: sudo apt-get install docker-compose + - name: Create .env file + run: echo "SONAR_TOKEN=${{ secrets.SONAR_TOKEN }}" > .env + - name: Build and Run SonarQube with Docker Compose run: docker-compose up -d diff --git a/docker-compose.yml b/docker-compose.yml index 6680cb53..6f2b44dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,7 +32,7 @@ services: - sonarnet environment: - SONAR_HOST_URL=http://sonar-server:9000 - - SONAR_TOKEN=${{ secrets.SONAR_TOKEN }} # GitHub Secret for SonarQube Token + - SONAR_TOKEN=${SONAR_TOKEN} # Use standard Docker variable interpolation here volumes: - .:/usr/src entrypoint: ["/bin/bash", "-c", "sonar-scanner -Dsonar.projectKey=Mutillidae-II-2 -Dsonar.sources=."]