ci(workflow): handle all cases of wip (#2162)

* ci(workflow): handle WIP all cases

* ci(workflow): refine WIP title checks for PR notifications

* ci(workflow): change PR trigger to pull_request_target to enable notifications from fork PRs
This commit is contained in:
anunay-xin 2026-03-19 12:00:15 +05:30 committed by GitHub
parent 8d93eb6e3d
commit 4321de607c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,9 +1,9 @@
# Notify Slack when a PR is ready for review (not draft, title does not contain WIP).
# Notify Slack when a PR is ready for review (not draft, title does not contain WIP/wip/Wip.).
# Triggers: new PR (non-draft, no WIP), draft -> ready, or title edited to remove WIP.
name: PR notify Slack
on:
pull_request:
pull_request_target:
types: [opened, reopened, ready_for_review, edited]
workflow_dispatch:
@ -28,15 +28,16 @@ jobs:
notify:
runs-on: ubuntu-latest
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.draft == false &&
!contains(github.event.pull_request.title, 'WIP') &&
!startsWith(github.event.pull_request.title, 'wip') &&
!startsWith(github.event.pull_request.title, '[wip]') &&
(
github.event.action != 'edited' ||
(
github.event.changes.title &&
(
contains(github.event.changes.title.from, 'WIP')
startsWith(github.event.changes.title.from, 'wip') ||
startsWith(github.event.changes.title.from, '[wip]')
)
)
)