diff --git a/tests/ci/pr_info.py b/tests/ci/pr_info.py index d72c8324b02..812834824b7 100644 --- a/tests/ci/pr_info.py +++ b/tests/ci/pr_info.py @@ -44,14 +44,14 @@ class PRInfo: self.changed_files = set([]) # workflow completed event, used for PRs only - if github_event['action'] == 'completed': + if 'action' in github_event and github_event['action'] == 'completed': self.sha = github_event['workflow_run']['head_sha'] prs_for_sha = requests.get(f"https://api.github.com/repos/{GITHUB_REPOSITORY}/commits/{self.sha}/pulls").json() if len(prs_for_sha) != 0: github_event['pull_request'] = prs_for_sha[0] if 'pull_request' in github_event: # pull request and other similar events - self.number = github_event['number'] + self.number = github_event['pull_request']['number'] if 'after' in github_event: self.sha = github_event['after'] else: