From 4fe3c5f48314fa22ffbecfe9a44ef30f7bbf1a2d Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 18 Dec 2025 13:37:45 -0600 Subject: [PATCH] fix(ci): correct Dockerfile path and skip SonarCloud when token missing --- .github/workflows/sonarcloud.yml | 12 ++++++++++++ .github/workflows/trivy.yml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 4c66a52a53..8cb2ce9f52 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -21,12 +21,24 @@ jobs: analyze: runs-on: ubuntu-latest steps: + - name: Check for SONAR_TOKEN + id: check-secret + run: | + if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then + echo "available=true" >> $GITHUB_OUTPUT + else + echo "available=false" >> $GITHUB_OUTPUT + echo "::warning::SONAR_TOKEN not configured - skipping SonarCloud scan" + fi + - name: Checkout + if: steps.check-secret.outputs.available == 'true' uses: actions/checkout@v4 with: fetch-depth: 0 - name: SonarCloud Scan + if: steps.check-secret.outputs.available == 'true' uses: SonarSource/sonarcloud-github-action@v2 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index c2bf576694..9f0dcdc71e 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 - name: Build Docker image - run: docker build -t ghcr.io/cheir-mneme/aletheia:${{ github.sha }} . + run: docker build -t ghcr.io/cheir-mneme/aletheia:${{ github.sha }} -f docker/Dockerfile . - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master