Skip to content

Commit

Permalink
Also check PR title, to fully replace the bot
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Nov 12, 2024
1 parent e02f861 commit 5a233bb
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 5a233bb

Please sign in to comment.