Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding coderabbitai-review.yml #2

Closed
wants to merge 2 commits into from
Closed
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
38 changes: 38 additions & 0 deletions .github/workflows/coderabbit-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
##############################################################################

Check warning on line 1 in .github/workflows/coderabbit-review.yml

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
##############################################################################
#
# NOTE!
#
# Please read the README.md file in this directory that defines what should
# be placed in this file
#
##############################################################################
##############################################################################

name: PR Review Status Trigger

on:
pull_request_review:
types: [submitted]
pull_request:
types: [opened, synchronize]

jobs:
pr-approval-trigger:
runs-on: ubuntu-latest
steps:
- name: Check if PR has been approved by CodeRabbit.ai
if: ${{ github.event_name == 'pull_request_review' && github.event.review.state == 'approved' }}
run: echo "This PR was approved by CodeRabbit.ai"

- name: Fail if PR is not approved by CodeRabbit.ai
if: ${{ github.event_name == 'pull_request_review' && github.event.review.state != 'approved' }}
run: |
echo "This PR was not approved by CodeRabbit.ai"
exit 1 # Fail the workflow if the review is not approved

- name: Fail if PR has not been reviewed by CodeRabbit.ai
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "This PR has not yet been reviewed by CodeRabbit.ai"
exit 1 # Fail the workflow if no review has been submitted
Loading