|
68 | 68 | echo "Generated channel name: $CHANNEL" |
69 | 69 |
|
70 | 70 | # Install Firebase CLI and deploy to preview channel |
| 71 | + # Only run if secrets are available (not on forks) |
71 | 72 | - name: Deploy to Firebase preview channel |
72 | 73 | id: firebase-deploy |
| 74 | + # Skip deployment for pull requests from forks (secrets are not available) |
| 75 | + if: ${{ secrets.FIREBASE_TOKEN != '' && secrets.FIREBASE_PROJECT_ID != '' }} |
73 | 76 | env: |
74 | 77 | FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |
75 | 78 | FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }} |
|
93 | 96 | echo "$DEPLOY_OUTPUT" |
94 | 97 | exit 1 |
95 | 98 | fi |
| 99 | + |
| 100 | + # Add note when deployment is skipped |
| 101 | + - name: Deployment skipped notice |
| 102 | + if: ${{ secrets.FIREBASE_TOKEN == '' || secrets.FIREBASE_PROJECT_ID == '' }} |
| 103 | + run: | |
| 104 | + cat >> $GITHUB_STEP_SUMMARY << 'EOF' |
| 105 | + ## ℹ️ Firebase Deployment Skipped |
| 106 | + |
| 107 | + Firebase deployment was skipped because the required secrets are not available. |
| 108 | + This typically happens for pull requests from forked repositories. |
| 109 | + |
| 110 | + **Build Status:** ✅ Build completed successfully |
| 111 | + |
| 112 | + ### What was tested: |
| 113 | + - ✅ Dependencies installed |
| 114 | + - ✅ Application built successfully |
| 115 | + - ✅ Tests passed |
| 116 | + |
| 117 | + ### Note for maintainers: |
| 118 | + To deploy a preview for this PR, a maintainer needs to either: |
| 119 | + 1. Close and reopen the PR from the main repository, or |
| 120 | + 2. Manually trigger a deployment after merging |
| 121 | + EOF |
| 122 | + echo "⚠️ Firebase deployment skipped - secrets not available (likely a fork PR)" |
96 | 123 |
|
97 | 124 | # Add preview URL to job summary |
98 | 125 | - name: Add deployment summary |
|
0 commit comments