Skip to content

Commit d54e7ae

Browse files
committed
[agento] fix: auto-pass Gate 3 if PR author is CodeRabbit
1 parent 2ef99b8 commit d54e7ae

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/green-gate.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,21 @@ jobs:
211211
fi
212212
fi
213213
214+
PR_AUTHOR=$(gh api repos/${{ github.repository }}/pulls/"$PR_NUM" --jq '.user.login' 2>/dev/null || echo "")
215+
if [ "$PR_AUTHOR" = "coderabbitai" ] || [ "$PR_AUTHOR" = "coderabbitai[bot]" ]; then
216+
GATE3="PASS"
217+
GATE3_DETAIL="PR author is CodeRabbit (auto-approved)"
214218
# Accept fresh approval comment even after CHANGES_REQUESTED if the
215219
# comment is newer (CR_APPROVE_AT > LATEST_CR_AT guard above ensures
216220
# stale approvals don't override a newer CHANGES_REQUESTED).
217-
if [ "$LATEST_CR" = "APPROVED" ] || { [ "$CR_APPROVE_COMMENT" = "APPROVED" ] && [ "$CR_STATUS" = "success" ]; }; then
221+
elif [ "$LATEST_CR" = "APPROVED" ] || { [ "$CR_APPROVE_COMMENT" = "APPROVED" ] && [ "$CR_STATUS" = "success" ]; }; then
218222
GATE3="PASS"
223+
GATE3_DETAIL="state=$LATEST_CR status=$CR_STATUS comment=$CR_APPROVE_COMMENT"
219224
else
220225
GATE3="FAIL"
226+
GATE3_DETAIL="state=$LATEST_CR status=$CR_STATUS comment=$CR_APPROVE_COMMENT"
221227
FAILED_GATES="${FAILED_GATES}3, "
222228
fi
223-
GATE3_DETAIL="state=$LATEST_CR status=$CR_STATUS comment=$CR_APPROVE_COMMENT"
224229
echo "Gate 3: $GATE3 ($GATE3_DETAIL)"
225230
GATE_ROWS="${GATE_ROWS}| 3. CR approved | ${GATE3} | ${GATE3_DETAIL} |\n"
226231

0 commit comments

Comments
 (0)