-
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 <callahan.kovacs@canonical.com>
- Loading branch information
Showing
5 changed files
with
63 additions
and
280 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/request-action@v2.3.1 | ||
with: | ||
route: POST /repos/${{ github.repository }}/issues/${{ github.event.number }}/labels | ||
mediaType: 'application/vnd.github.v3+json' | ||
labels: needs-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/request-action@v2.3.1 | ||
with: | ||
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.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/request-action@v2.3.1 | ||
with: | ||
route: POST /repos/${{ github.repository }}/pulls/${{ github.event.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/request-action@v2.3.1 | ||
with: | ||
route: DELETE /repos/${{ github.repository }}/issues/${{ github.event.number }}/labels | ||
mediaType: 'application/vnd.github.v3+json' | ||
labels: need-starcraft-review | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.