Skip to content

Commit

Permalink
request review from oss team members
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
  • Loading branch information
harupy committed Jan 29, 2024
1 parent 8513570 commit daf78c4
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/review.yml
@@ -0,0 +1,40 @@
name: Review

on:
pull_request:
types: [review_requested]

jobs:
specific_review_requested:
runs-on: ubuntu-latest
if: ${{ github.event.requested_team.name == 'mlflow-team'}}
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const members = [
"B-Step62",
"BenWilson2",
"daniellok-db",
"harupy",
"serena-ruan",
"WeichenXu123",
];
const author = context.payload.pull_request.user.login;
const reviews = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
const approved = reviews.data.filter((r) => r.state === "APPROVED").map((r) => r.user.login);
console.log(members.filter((m) => !approved.includes(m) && m !== author));
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
reviewers: members.filter((m) => !approved.includes(m) && m !== author),
});

0 comments on commit daf78c4

Please sign in to comment.