Skip to content

fix: update the configuration schedule plan #61

fix: update the configuration schedule plan

fix: update the configuration schedule plan #61

name: Mergeable Check
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
jobs:
mergeable-check:
runs-on: ubuntu-latest
steps:
- name: Check Mergeable
env:
TOKEN: "admin:sadkfasdj123123"
run: |
OWNER=${{ github.repository_owner }}
REPO=${{ github.event.repository.name }}
PR_NUMBER=${{ github.event.pull_request.number }}
ENCODED_TOKEN=$(echo -n $TOKEN | base64)
API_URL="http://124.222.18.13:8080/public/v1/codereview/${OWNER}/${REPO}/pull/${PR_NUMBER}/status"
RESPONSE=$(curl -s -H "Authorization: Basic $ENCODED_TOKEN" $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"