Skip to content

fix: update the readme #16

fix: update the readme

fix: update the readme #16

name: Mergeable Check
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
jobs:
label-check:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check PR Labels
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
LABELS=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name')
REQUIRED_LABELS=("ready" "lgtm" "approved")
for LABEL in "${REQUIRED_LABELS[@]}"; do
if ! echo "$LABELS" | grep -q "$LABEL"; then
echo "Missing required label: $LABEL, unalbe to merge"
exit 1
fi
done
if echo "$LABELS" | grep -q "hold"; then
echo "Label 'hold' is present, unable to merge."
exit 1
fi