Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Trigger on opened PR, ready for review or sourcery-review label #4

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 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 in non-draft state
brendanator marked this conversation as resolved.
Show resolved Hide resolved
# - 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
brendanator marked this conversation as resolved.
Show resolved Hide resolved
- ready_for_review
brendanator marked this conversation as resolved.
Show resolved Hide resolved
brendanator marked this conversation as resolved.
Show resolved Hide resolved
- labeled

permissions:
Expand All @@ -27,10 +29,12 @@ 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 in non draft state,
brendanator marked this conversation as resolved.
Show resolved Hide resolved
# 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.action == 'opened' && !github.event.pull_request.draft ||
brendanator marked this conversation as resolved.
Show resolved Hide resolved
github.event.action == 'ready_for_review' ||
github.event.label.name == 'sourcery-review'

runs-on: ubuntu-latest
Expand Down