diff --git a/.github/workflows/check-labels.yaml b/.github/workflows/check-title-and-labels.yaml similarity index 71% rename from .github/workflows/check-labels.yaml rename to .github/workflows/check-title-and-labels.yaml index 5e8dcdb7a84..8d45d3997f0 100644 --- a/.github/workflows/check-labels.yaml +++ b/.github/workflows/check-title-and-labels.yaml @@ -1,17 +1,27 @@ # based on https://stackoverflow.com/a/75036059 and # https://github.com/astropy/astropy/blob/main/.github/workflows/check_milestone.yml -name: Check PR labels +name: Check PR title and labels on: # So it cannot be skipped. pull_request_target: - types: [opened, synchronize, labeled, unlabeled] + types: [opened, edited, synchronize, labeled, unlabeled] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true jobs: + check-title: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + with: + script: | + if (/^\[?WIP\b/i.test(context.payload.pull_request.title)) { + core.setFailed("WIP pull requests can't be merged."); + } + check-labels: runs-on: ubuntu-latest steps: