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.
This commit is contained in:
Ryan Walters
2025-11-23 11:48:58 -06:00
parent 0338188e94
commit cc6a1a4c6a
2 changed files with 17 additions and 0 deletions

View File

@@ -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