Skip to content

Commit 23dc2b7

Browse files
authored
feat: Trigger on opened PR, ready for review or sourcery-review label (#4)
1 parent e5dd981 commit 23dc2b7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/sourcery_code_review.yaml

+10-6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ on:
88
types:
99
# Trigger the review when either of these events occur:
1010
#
11-
# - a review is requested from any user
11+
# - a pull request is opened and is not in draft state
12+
# - a pull request is moved from draft to ready for review
1213
# - the "sourcery-review" label is added to the pull request: add this label
1314
# to your pull request to trigger a review. To re-request reviews, remove the
1415
# label and add it again.
1516
#
1617
# Feel free to edit this list to suit your team's needs. See the list of all
1718
# activity types here:
1819
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
19-
- review_requested
20+
- opened
21+
- ready_for_review
2022
- labeled
2123

2224
permissions:
@@ -27,11 +29,13 @@ permissions:
2729

2830
jobs:
2931
sourcery-coding-assistant-review:
30-
# Only run this job when a review is requested or the "sourcery-review"
31-
# label is added to the pull request.
32+
# Only run this job when a PR is opened and is not in draft state,
33+
# is moved from draft to ready for review,
34+
# or the "sourcery-review" label is added to the pull request.
3235
if: |
33-
github.event.action == 'review_requested' ||
34-
github.event.label.name == 'sourcery-review'
36+
github.event.action == 'opened' && !github.event.pull_request.draft ||
37+
github.event.action == 'ready_for_review' ||
38+
github.event.action == 'labeled' && github.event.label.name == 'sourcery-review'
3539
3640
runs-on: ubuntu-latest
3741

0 commit comments

Comments
 (0)