From 60bee991242a2f0f6373d872bd876b1ae966902c Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sun, 6 Dec 2020 21:48:35 -0500 Subject: [PATCH] actions: fix assigning reviewers Bail if reviewer is not a collaborator. Signed-off-by: Anas Nashif --- .github/workflows/maintainer.yml | 4 ++-- scripts/maintainers/action.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maintainer.yml b/.github/workflows/maintainer.yml index e2889c0a2dd48..50b3717c341b1 100644 --- a/.github/workflows/maintainer.yml +++ b/.github/workflows/maintainer.yml @@ -2,6 +2,7 @@ name: 'Pull Request Assigner' on: - pull_request + jobs: assign: runs-on: ubuntu-latest @@ -12,7 +13,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - pip3 install wheel setuptools - pip3 install pykwalify pyGithub + pip3 install wheel setuptools pykwalify pyGithub python3 scripts/maintainers/action.py diff --git a/scripts/maintainers/action.py b/scripts/maintainers/action.py index 29ebc49bbbf23..048087806e90d 100644 --- a/scripts/maintainers/action.py +++ b/scripts/maintainers/action.py @@ -82,7 +82,11 @@ def main(): reviewers.append(c) if reviewers: - gh_pr.create_review_request(reviewers=reviewers) + try: + gh_pr.create_review_request(reviewers=reviewers) + except: + log("cant add reviewer") + pass ms = [] if maintainers: