RPC Health Check #97
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: RPC Health Check | |
| on: | |
| schedule: | |
| # Run at 7 AM UTC daily (1 hour after nightly E2E tests) | |
| - cron: '0 7 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| health-check: | |
| name: RPC Health Check | |
| runs-on: ubuntu-latest | |
| # Only run on main repo (not forks) due to secrets requirement | |
| if: github.repository == 'teng-lin/notebooklm-py' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Run RPC Health Check | |
| id: health | |
| continue-on-error: true | |
| shell: bash | |
| env: | |
| NOTEBOOKLM_AUTH_JSON: ${{ secrets.NOTEBOOKLM_AUTH_JSON }} | |
| NOTEBOOKLM_READ_ONLY_NOTEBOOK_ID: ${{ secrets.NOTEBOOKLM_READ_ONLY_NOTEBOOK_ID }} | |
| NOTEBOOKLM_GENERATION_NOTEBOOK_ID: ${{ secrets.NOTEBOOKLM_GENERATION_NOTEBOOK_ID }} | |
| run: | | |
| set +e | |
| python scripts/check_rpc_health.py --full 2>&1 | tee health-report.txt | |
| exit_code=${PIPESTATUS[0]} | |
| echo "exit_code=${exit_code}" >> "$GITHUB_OUTPUT" | |
| exit $exit_code | |
| - name: Add Summary | |
| if: always() | |
| shell: bash | |
| run: | | |
| echo "## RPC Health Check Results" >> $GITHUB_STEP_SUMMARY | |
| grep -A 10 "^SUMMARY$" health-report.txt >> $GITHUB_STEP_SUMMARY || echo "No summary found" >> $GITHUB_STEP_SUMMARY | |
| - name: Create Issue on RPC Mismatch | |
| if: steps.health.outputs.exit_code == '1' | |
| uses: peter-evans/create-issue-from-file@v6 | |
| with: | |
| title: "RPC ID Mismatch Detected" | |
| content-filepath: health-report.txt | |
| labels: bug, rpc-breakage, automated | |
| - name: Create Issue on Auth Failure | |
| if: steps.health.outputs.exit_code == '2' | |
| uses: peter-evans/create-issue-from-file@v6 | |
| with: | |
| title: "RPC Health Check: Authentication Failure" | |
| content-filepath: health-report.txt | |
| labels: bug, automated | |
| - name: Upload Report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: rpc-health-report | |
| path: health-report.txt | |
| retention-days: 30 | |
| - name: Fail if health check failed | |
| if: steps.health.outcome == 'failure' | |
| run: | | |
| echo "RPC Health Check failed (exit code: ${{ steps.health.outputs.exit_code }}). See report above." | |
| exit 1 |