Skip to content

Commit

Permalink
Merge pull request #886 from DEFRA/fix/merge-gh-action
Browse files Browse the repository at this point in the history
FSR-0000 | Fix/merge gh action
  • Loading branch information
LeeGordon83 authored Nov 19, 2024
2 parents c0eedc7 + ae9b703 commit 270c4f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +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" and .reviews[].state == "APPROVED") | .reviews[].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[].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 270c4f4

Please sign in to comment.