From cc6a1a4c6afaee494725d8da190417614d497bad Mon Sep 17 00:00:00 2001 From: Ryan Walters Date: Sun, 23 Nov 2025 11:48:58 -0600 Subject: [PATCH] fix(ci): skip Railway deployment and Coveralls upload when tokens unavailable Dependabot PRs lack access to repository secrets, causing workflow failures. This change adds token availability checks with informative warnings, allowing CI to complete successfully while skipping deployment steps that require secrets. Coverage generation still runs to maintain build verification, but upload is conditional on token availability. --- .github/workflows/coverage.yaml | 8 ++++++++ .github/workflows/deploy.yaml | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index f7df344..1c5d984 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -56,6 +56,14 @@ jobs: just coverage working-directory: pacman + - name: Check Coveralls Token + run: | + if [ -z "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then + echo "::warning::COVERALLS_REPO_TOKEN not available - coverage upload skipped (common for Dependabot PRs)" + else + echo "COVERALLS_REPO_TOKEN is available - will upload coverage" + fi + - name: Coveralls upload if: ${{ secrets.COVERALLS_REPO_TOKEN != '' }} uses: coverallsapp/github-action@v2 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d6411c0..ee98116 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -132,8 +132,17 @@ jobs: env: RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} steps: + - name: Check Railway Token + run: | + if [ -z "$RAILWAY_TOKEN" ]; then + echo "::warning::RAILWAY_TOKEN not available - deployment skipped (common for Dependabot PRs)" + exit 0 + fi + - name: Generate proxy Dockerfile + if: env.RAILWAY_TOKEN != '' run: echo "FROM ghcr.io/xevion/pac-man@${{ needs.build-and-deploy.outputs.digest }}" > Dockerfile - name: Deploy to Railway + if: env.RAILWAY_TOKEN != '' run: railway up --service pac-man