Skip to content

Commit

Permalink
feat: Trigger on opened PR, ready for review or sourcery-review lab…
Browse files Browse the repository at this point in the history
…el (#4)
  • Loading branch information
brendanator authored Nov 29, 2023
1 parent e5dd981 commit 23dc2b7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/sourcery_code_review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ on:
types:
# Trigger the review when either of these events occur:
#
# - a review is requested from any user
# - a pull request is opened and is not in draft state
# - a pull request is moved from draft to ready for review
# - the "sourcery-review" label is added to the pull request: add this label
# to your pull request to trigger a review. To re-request reviews, remove the
# label and add it again.
#
# Feel free to edit this list to suit your team's needs. See the list of all
# activity types here:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
- review_requested
- opened
- ready_for_review
- labeled

permissions:
Expand All @@ -27,11 +29,13 @@ permissions:

jobs:
sourcery-coding-assistant-review:
# Only run this job when a review is requested or the "sourcery-review"
# label is added to the pull request.
# Only run this job when a PR is opened and is not in draft state,
# is moved from draft to ready for review,
# or the "sourcery-review" label is added to the pull request.
if: |
github.event.action == 'review_requested' ||
github.event.label.name == 'sourcery-review'
github.event.action == 'opened' && !github.event.pull_request.draft ||
github.event.action == 'ready_for_review' ||
github.event.action == 'labeled' && github.event.label.name == 'sourcery-review'
runs-on: ubuntu-latest

Expand Down

0 comments on commit 23dc2b7

Please sign in to comment.