name: Release Doctor
on:
  pull_request:
  workflow_dispatch:

jobs:
  release_doctor:
    name: release doctor
    runs-on: ubuntu-latest
    if: github.repository == 'cloudflare/cloudflare-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

    steps:
      - uses: actions/checkout@v3

      - name: Check release environment
        run: |
          bash ./bin/check-release-environment
        env:
          PYPI_TOKEN: ${{ secrets.CLOUDFLARE_PYPI_TOKEN || secrets.PYPI_TOKEN }}
