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

Adjust the API in use by merge-bot #618

Merged
merged 1 commit into from
Nov 17, 2024
Merged
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
14 changes: 6 additions & 8 deletions scripts/merge_procedures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,29 @@ if [[ "$REQUEST" == "bot: MERGE trial" ]]; then
MY_MESSAGE+="No changes will be submitted to GitHub."
TRIAL="true"
fi
gh pr checkout "$PR_URL"

REVIEWS_STATUS="$(gh pr status --json latestReviews --jq '.currentBranch.latestReviews[].state == "APPROVED"')"
REVIEWS_STATUS="$(gh pr view "$PR_URL" --json reviewDecision --jq '.reviewDecision == "APPROVED"')"
APPROVALS="$(echo "$REVIEWS_STATUS" | grep -c 'true' || true)"
MERGE_STATUS="$(gh pr status --json mergeStateStatus --jq '.currentBranch.mergeStateStatus == "CLEAN"')"
MERGE_STATUS="$(gh pr view "$PR_URL" --json mergeStateStatus --jq '.mergeStateStatus == "CLEAN"')"
STATUS="$(echo "$MERGE_STATUS" | grep -c 'true' || true)"

echo "**********************************************************************"
echo -e "Approvals: $APPROVALS"
echo -e "Approved: $REVIEWS_STATUS"
echo -e "Mergeable: $MERGE_STATUS"
echo -e "$MY_MESSAGE"
echo -e "---------------"
echo -e "Reviews: $REVIEWS_STATUS"
echo "**********************************************************************"

if [[ "$TRIAL" == 'true' ]]; then
echo "latestReviews: $(gh pr status --json latestReviews)"
echo "mergeStateStatus: $(gh pr status --json mergeStateStatus)"
echo "reviewDecision: $(gh pr view "$PR_URL" --json reviewDecision)"
echo "mergeStateStatus: $(gh pr view "$PR_URL" --json mergeStateStatus)"
echo "**********************************************************************"
fi
git config --global user.name "Continuous Integration"
git config --global user.email "[email protected]"
DEST_BRANCH="$BRANCH"

if [[ ("$APPROVALS" -ge 1 && "$STATUS" -eq 1) || "$SKIP" == 'true' ]]; then
if [[ ("$APPROVALS" -ge 1 && "$STATUS" -ge 1) || "$SKIP" == 'true' ]]; then
if [[ "$OWNER" != "openwall" ]]; then
echo "The PR comes from a fork."
DEST_BRANCH="$OWNER-$BRANCH"
Expand Down
Loading