Skip to content

Commit

Permalink
ci(mergify): use mergify to request reviewers (#1657)
Browse files Browse the repository at this point in the history
Signed-off-by: Thuan Vo <[email protected]>
  • Loading branch information
Thuan Vo authored Sep 7, 2023
1 parent 93f1089 commit 8af8a4b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 40 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/pr-remove-request-review.yml

This file was deleted.

20 changes: 5 additions & 15 deletions .github/workflows/pr-request-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,12 @@ on:
jobs:
request-review:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
pull-requests: write
if: github.repository_owner == 'cryostatio' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/request_review')
env:
REVIEWERS_TEAM: 'cryostatio/reviewers'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Add label and request review
run: |
echo "Adding label 'review-requested' to the PR"
gh pr edit ${{ github.event.issue.number }} --add-label "review-requested"
echo "Requesting review from @$REVIEWERS_TEAM"
gh pr edit ${{ github.event.issue.number }} --add-reviewer $REVIEWERS_TEAM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: |
# Adding label 'review-requested' to the PR. Mergify will add reviewers.
gh pr edit ${{ github.event.issue.number }} --add-label "review-requested" --repo ${{ github.event.repository.full_name }}
19 changes: 19 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,22 @@ pull_request_rules:
is updated. Please revert or drop all changes to the `web-client` submodule from this PR and perform any
required frontend work by opening and merging a PR against
[cryostat-web](https://github.com/cryostatio/cryostat-web).
- name: request reviews from the reviewers team
conditions:
- label=review-requested
actions:
request_reviews:
teams:
- "@cryostatio/reviewers"

- name: remove review-requested label upon reviewing
conditions:
- or:
- "#approved-reviews-by>0"
- "#changes-requested-reviews-by>0"
- "#commented-reviews-by>0"
actions:
label:
remove:
- review-requested

0 comments on commit 8af8a4b

Please sign in to comment.