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

Added Code Rabbit Approval Check to pull-request.yml Workflow #3008

Merged
Merged
Changes from 2 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
02049cc
Update coderabbit approval
mandeepnh5 Dec 28, 2024
b5d8c8e
Update .github/workflows/pull-request.yml
mandeepnh5 Dec 28, 2024
dbe1183
Merge branch 'develop-postgres' into coderabbit-workflow
mandeepnh5 Dec 28, 2024
ac05f7e
Fix some issues
mandeepnh5 Dec 28, 2024
54914b8
Update code for testing in pr
mandeepnh5 Dec 28, 2024
6579d01
Fix issues related to if-fi
mandeepnh5 Dec 28, 2024
d027c8c
Merge branch 'develop-postgres' into coderabbit-workflow
mandeepnh5 Dec 29, 2024
47b1c9c
Update pull-request.yml
mandeepnh5 Dec 29, 2024
df0ee04
Update .github/workflows/pull-request.yml
mandeepnh5 Dec 29, 2024
c5e1dd5
Merge branch 'develop-postgres' into coderabbit-workflow
mandeepnh5 Dec 29, 2024
9b88bf0
intentionally failing coderabbit
mandeepnh5 Dec 29, 2024
30d1e41
Fix some issues
mandeepnh5 Dec 29, 2024
b6f6efa
Update .github/workflows/pull-request.yml
mandeepnh5 Dec 29, 2024
c59204d
Update pull-request.yml
mandeepnh5 Dec 29, 2024
4b5ffce
Merge branch 'develop-postgres' into coderabbit-workflow
mandeepnh5 Dec 29, 2024
aa3afd6
Update pull-request.yml
mandeepnh5 Dec 29, 2024
4c1efc5
Update pull-request.yml
mandeepnh5 Dec 29, 2024
ac8c24a
Fix issues and intentional coderabbit fail
mandeepnh5 Dec 29, 2024
32c8fae
Intentional code rabbit fail
mandeepnh5 Dec 29, 2024
1a93441
Update coderabbit check in scripts folder
mandeepnh5 Dec 29, 2024
64f46a9
Update .github/workflows/scripts/validate-coderabbit.yml
mandeepnh5 Dec 29, 2024
12bdd8e
Update .github/workflows/scripts/validate-coderabbit.yml
mandeepnh5 Dec 29, 2024
5b4115d
Update needs for coderabbit
mandeepnh5 Dec 29, 2024
ea995d1
Update scripts folder issue
mandeepnh5 Dec 29, 2024
f421a47
Fix issue in yml file
mandeepnh5 Dec 29, 2024
1097ba3
Update .github/workflows/scripts/validate-coderabbit.sh
mandeepnh5 Dec 29, 2024
6b3de90
Update coderabbit suggestions
mandeepnh5 Dec 29, 2024
d16ea25
Fix some issues
mandeepnh5 Dec 29, 2024
b164507
Merge branch 'develop-postgres' into coderabbit-workflow
mandeepnh5 Dec 29, 2024
e2b579b
Fix some path issues
mandeepnh5 Dec 29, 2024
0dadb1a
Fix some script issues
mandeepnh5 Dec 29, 2024
d9ef72e
Update .github/workflows/pull-request.yml
mandeepnh5 Dec 29, 2024
8375a9d
Fix some issues
mandeepnh5 Dec 29, 2024
c2acb0e
Update .github/workflows/scripts/validate-coderabbit.sh
mandeepnh5 Dec 29, 2024
935e8a5
Update .github/workflows/scripts/validate-coderabbit.sh
mandeepnh5 Dec 29, 2024
e8574d2
Fix github pagination
mandeepnh5 Dec 29, 2024
188e10f
Update .github/workflows/scripts/validate-coderabbit.sh
mandeepnh5 Dec 29, 2024
b6360b8
Update .github/workflows/scripts/validate-coderabbit.sh
mandeepnh5 Dec 29, 2024
44d9953
Update .github/workflows/scripts/validate-coderabbit.sh
mandeepnh5 Dec 29, 2024
6868f3f
Merge branch 'develop-postgres' into coderabbit-workflow
mandeepnh5 Dec 29, 2024
2504d44
Fix github pagination
mandeepnh5 Dec 31, 2024
62822f6
Fix some issues
mandeepnh5 Dec 31, 2024
9f3896a
Removed debug statements
mandeepnh5 Dec 31, 2024
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
34 changes: 34 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##############################################################################

Check warning on line 1 in .github/workflows/pull-request.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!
Expand Down Expand Up @@ -462,3 +462,37 @@
run: |
echo "Error: Pull request target branch must be 'develop-postgres'. Please refer PR_GUIDELINES.md"
exit 1

CodeRabbit-Approval:
name: Validate CodeRabbit.ai Approval
needs: [Code-Quality-Checks, Docker-Start-Check, Start-App-Without-Docker, Test-Application]
runs-on: ubuntu-latest
steps:
- name: Check CodeRabbit.ai Approval
run: |
reviews=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews) || {
echo "Error: Failed to fetch PR reviews"
exit 1
}

if ! echo "$reviews" | jq . >/dev/null 2>&1; then
echo "Error: Invalid JSON response from GitHub API"
exit 1
}

approval_count=$(echo "$reviews" | jq '[.[] | select(.state == "APPROVED" and .user.login == "coderabbitai")] | length')

if [[ ! "$approval_count" =~ ^[0-9]+$ ]]; then
echo "Error: Failed to parse approval count"
exit 1
}

if [[ $approval_count -eq 0 ]]; then
echo "Error: PR is not approved by CodeRabbit.ai"
exit 1
else
echo "Success: PR approved by CodeRabbit.ai"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading