Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .config/review.polkacodes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rules:
- repo: polka-codes/prompts
path: review/preamble.md
branch: master
- repo: polka-codes/prompts
path: review/rust.md
branch: master
- repo: polka-codes/prompts
path: review/polkadot-sdk.md
branch: master
2 changes: 1 addition & 1 deletion .github/scripts/cmd/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def main():
# Output labels as JSON for GitHub Action
import json
labels_output = {"labels": final_labels}
print(f"LABELS_JSON: {json.dumps(labels_output)}")
print_and_log(f"LABELS_JSON: {json.dumps(labels_output)}")
except ValueError as e:
print_and_log(f'❌ {e}')

Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/ai-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: AI PR Review

on:
# pull_request: # enable this when we think this is ready
# types: [opened, ready_for_review]
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to review'
required: true
type: number

permissions:
contents: read
pull-requests: write

concurrency:
group: review-pr-${{ github.event.inputs.pr_number || github.event.number }}
cancel-in-progress: true

jobs:
review:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Process PR
uses: polka-codes/action@v2
with:
pr_number: ${{ github.event.inputs.pr_number || github.event.number }}
review: true
config: .config/review.polkacodes.yml
env:
POLKA_API_PROVIDER: google
POLKA_MODEL: gemini-3-pro-preview
GITHUB_TOKEN: ${{ github.token }}
POLKA_API_KEY: ${{ secrets.GEMINI_API_KEY }}
POLKA_BUDGET: 5

11 changes: 9 additions & 2 deletions .github/workflows/cmd-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,19 @@ jobs:
repository: ${{ env.REPO }}
ref: ${{ env.PR_BRANCH }}

- name: Download all artifacts
- name: Download command-diff artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: command-diff
path: command-diff

- name: Download command-output artifact
if: startsWith(github.event.inputs.cmd, 'label')
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: command-output
path: command-output

- name: Apply labels for label command
if: startsWith(github.event.inputs.cmd, 'label')
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
Expand All @@ -310,7 +317,7 @@ jobs:
let labels = [];

try {
const output = fs.readFileSync('/tmp/cmd/command_output.log', 'utf8');
const output = fs.readFileSync('command-output/command_output.log', 'utf8');

// Parse JSON labels from output - look for "LABELS_JSON: {...}"
const jsonMatch = output.match(/LABELS_JSON: (.+)/);
Expand Down
Loading