Skip to content

fix: update the readme #34

fix: update the readme

fix: update the readme #34

name: Mergeable Check
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
jobs:
mergeable-check:
runs-on: ubuntu-latest
steps:
- name: Check Mergeable
run: |
OWNER=${{ github.repository_owner }}
REPO=${{ github.event.repository.name }}
PR_NUMBER=${{ github.event.pull_request.number }}
API_URL="http://124.222.18.13:8080/public/v1/codereview/${OWNER}/${REPO}/pull/${PR_NUMBER}/mergeable"
RESPONSE=$(curl -s $API_URL)
MERGEABLE=$(echo $RESPONSE | jq -r '.mergeable')
MESSAGE=$(echo $RESPONSE | jq -r '.message')
if [ "$MERGEABLE" != "true" ]; then
echo "PR is not mergeable: $MESSAGE"
exit 1
fi
echo "PR is mergeable: $MESSAGE"