feat: add TTL cache for API response caching #6
Workflow file for this run
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: PR Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| review: | |
| name: Relay PR Review | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install pi-relay | |
| id: relay | |
| run: | | |
| git clone --depth=1 https://github.com/benaiad/pi-relay.git /tmp/pi-relay | |
| cd /tmp/pi-relay && npm ci && npm run build | |
| echo "root=/tmp/pi-relay" >> "$GITHUB_OUTPUT" | |
| - name: Run PR review | |
| run: | | |
| node ${{ steps.relay.outputs.root }}/dist/cli/main.js \ | |
| bundled/ci/pr-review.md \ | |
| -e pr_number="${{ github.event.pull_request.number }}" \ | |
| --model "$RELAY_MODEL" \ | |
| --thinking "${RELAY_THINKING:-off}" | |
| env: | |
| RELAY_MODEL: ${{ secrets.RELAY_MODEL }} | |
| RELAY_THINKING: ${{ secrets.RELAY_THINKING }} | |
| RELAY_PLAN_DIR: ${{ steps.relay.outputs.root }}/bundled/ci | |
| GH_TOKEN: ${{ github.token }} | |
| # Add your provider's API key secret below. Name depends on provider: | |
| # zai → ZAI_API_KEY, anthropic → ANTHROPIC_API_KEY, openai → OPENAI_API_KEY | |
| ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }} |