From 8135ffa926845b40b91ad1ec475edd3a9e8d7079 Mon Sep 17 00:00:00 2001 From: Sergii Dymchenko Date: Wed, 31 May 2023 23:05:32 -0700 Subject: [PATCH] Fix docathon-label-sync.py to not fail on PRs without description See https://github.com/pytorch/tutorials/actions/runs/5140794478/jobs/9252588225?pr=2377 as an example --- .github/scripts/docathon-label-sync.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/scripts/docathon-label-sync.py b/.github/scripts/docathon-label-sync.py index 597f4b5e034..5da80f24f5b 100644 --- a/.github/scripts/docathon-label-sync.py +++ b/.github/scripts/docathon-label-sync.py @@ -14,6 +14,9 @@ def main(): repo = g.get_repo(f'{repo_owner}/{repo_name}') pull_request = repo.get_pull(pull_request_number) pull_request_body = pull_request.body + # PR without description + if pull_request_body is None: + return # get issue number from the PR body if not re.search(r'#\d{1,5}', pull_request_body):