diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 9790c6ab..92946a1c 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -30,9 +30,13 @@ jobs: echo "✅ Required secrets validated" - name: Test Grafana Cloud Loki Connection - if: ${{ secrets.GRAFANA_LOKI_URL != '' }} continue-on-error: true run: | + if [ -z "${{ secrets.GRAFANA_LOKI_URL }}" ]; then + echo "⏭️ Skipping Loki connection test (GRAFANA_LOKI_URL not configured)" + exit 0 + fi + echo "🔍 Testing Grafana Cloud Loki connection..." timestamp=$(date +%s)000000000 @@ -90,9 +94,13 @@ jobs: run: npx playwright install --with-deps ${{ matrix.browser }} - name: Send Test Start Event to Loki - if: ${{ secrets.GRAFANA_LOKI_URL != '' }} continue-on-error: true run: | + if [ -z "${{ secrets.GRAFANA_LOKI_URL }}" ]; then + echo "⏭️ Skipping Loki logging (GRAFANA_LOKI_URL not configured)" + exit 0 + fi + timestamp=$(date +%s)000000000 response=$(curl -s -w "\n%{http_code}" \ @@ -168,9 +176,14 @@ jobs: fi - name: Send Test Results to Loki - if: always() && secrets.GRAFANA_LOKI_URL != '' + if: always() continue-on-error: true run: | + if [ -z "${{ secrets.GRAFANA_LOKI_URL }}" ]; then + echo "⏭️ Skipping Loki logging (GRAFANA_LOKI_URL not configured)" + exit 0 + fi + STATUS="${{ steps.playwright-run.outputs.test_exit_code == '0' && 'success' || 'failure' }}" timestamp=$(date +%s)000000000