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

[DRAFT] ci: add reviewers workflow #4851

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 21 additions & 0 deletions .github/workflows/add-reviewer-label.yaml
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.number }}/labels
mediaType: 'application/vnd.github.v3+json'
labels: '["needs-starcraft-review"]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/add-reviewers.yaml
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.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.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.number }}/labels
mediaType: 'application/vnd.github.v3+json'
labels: '["needs-starcraft-review"]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 0 additions & 62 deletions .github/workflows/publish.yaml

This file was deleted.

124 changes: 0 additions & 124 deletions .github/workflows/spread.yml

This file was deleted.

94 changes: 0 additions & 94 deletions .github/workflows/tox.yaml

This file was deleted.

Loading