mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-05 23:15:40 -06:00
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:
8
.github/workflows/coverage.yaml
vendored
8
.github/workflows/coverage.yaml
vendored
@@ -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
|
||||
|
||||
9
.github/workflows/deploy.yaml
vendored
9
.github/workflows/deploy.yaml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user