Skip to content

Commit ff96a7e

Browse files
committed
Add/update CodeRabbit review workflow
1 parent c850dc9 commit ff96a7e

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Require CodeRabbit Review
2+
on: [pull_request]
3+
permissions:
4+
pull-requests: write
5+
contents: read
6+
7+
jobs:
8+
check-review:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check for CodeRabbit Review
12+
run: |
13+
# Fetch PR comments and check if @coderabbitai has posted a review summary
14+
COMMENTS=$(gh pr view $PR_NUMBER --json comments --jq '.comments[] | select(.author.login == "coderabbitai") | .body')
15+
if [[ ! "$COMMENTS" =~ "review summary" ]]; then # Adjust regex for CodeRabbit's typical summary marker
16+
echo "❌ CodeRabbit review required! Comment '@coderabbitai review' to trigger."
17+
exit 1
18+
fi
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
PR_NUMBER: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)