name: Require Milestone
on:
  pull_request:
    types: [opened, edited, synchronize]
jobs:
  milestone:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Require Milestone
        run: |
          exit $(gh pr view ${{ github.event.pull_request.number }} --json milestone | jq 'if .milestone == null then 1 else 0 end')
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
