-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Callahan Kovacs <[email protected]>
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add `needs-starcraft-review` if starcraft-reviewers is added as a reviewer | ||
|
||
name: add-reviewer-label | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- review_requested | ||
|
||
jobs: | ||
add-reviewer-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Add 'needs-starcraft-review' label | ||
uses: octokit/[email protected] | ||
with: | ||
route: POST /repos/${{ github.repository }}/issues/$ {{ github.event.pull_request.number }}/labels | ||
mediaType: 'application/vnd.github.v3+json' | ||
labels: need-starcraft-review | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# If there are not 2 reviews, re-add starcraft-reviewers when reviewed by the starcraft-reviewers team | ||
# Otherwise, drop the `need-starcraft-review` label | ||
|
||
name: add-reviewer | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
jobs: | ||
add-reviewer: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: check number of reviews | ||
id: check-reviews | ||
uses: octokit/[email protected] | ||
with: | ||
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews | ||
mediaType: 'application/vnd.github.v3+json' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: re-add team if there are not enough reviews | ||
if: steps.check-reviews.outputs.data | fromJson | length < 2 | ||
uses: octokit/[email protected] | ||
with: | ||
route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers | ||
mediaType: 'application/vnd.github.v3+json' | ||
reviewers: starcraft-reviewers | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: drop label if there are enough reviews | ||
if: steps.check-reviews.outputs.data | fromJson | length >= 2 | ||
uses: octokit/[email protected] | ||
with: | ||
route: DELETE /repos/${{ github.repository }}/issues/$ {{ github.event.pull_request.number }}/labels | ||
mediaType: 'application/vnd.github.v3+json' | ||
labels: need-starcraft-review | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |