Skip to content

Commit

Permalink
github action merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeGordon83 committed Nov 19, 2024
1 parent dbe2503 commit 978856a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ jobs:
function prCheck () {
REPO=$1
BASE=$2
STATE=$(gh pr list --repo $GITHUB_REPOSITORY_OWNER/$REPO --json title,mergeStateStatus,state,reviews \
--state OPEN --base $BASE --head $RELEASE_BRANCH \
--jq '.[] | select(.mergeStateStatus == "CLEAN") | .reviews | max_by(.submittedAt) | .state')
STATE=$(gh pr list --repo $GITHUB_REPOSITORY_OWNER/$REPO --json title,mergeStateStatus,state,reviews --state OPEN --base $BASE --head $RELEASE_BRANCH --jq '.[] | select(.mergeStateStatus == "CLEAN" and .reviews[-1].state == "APPROVED") | .reviews[-1].state')
if [ "$STATE" != "APPROVED" ]; then
echo "Error: PR for merging $GITHUB_REPOSITORY_OWNER/$REPO $RELEASE_BRANCH into $BASE needs to be ready to merge and approved. (STATE=$STATE)" >&2
exit 1
Expand Down

0 comments on commit 978856a

Please sign in to comment.