diff --git a/alibot_helpers/github_utilities.py b/alibot_helpers/github_utilities.py index bded9d83..6124f74e 100644 --- a/alibot_helpers/github_utilities.py +++ b/alibot_helpers/github_utilities.py @@ -251,6 +251,8 @@ def post(self, url, data, stable_api=True, **kwds): data = json.dumps(data) if type(data) == dict else data response = requests.post(url=url, data=data, headers=headers) sc = response.status_code + if sc == 422: + print(f"GitHub error: Unprocessable Entity", file=sys.stderr) return sc @trace diff --git a/report-pr-errors b/report-pr-errors index 37538105..c356ffb8 100755 --- a/report-pr-errors +++ b/report-pr-errors @@ -467,7 +467,7 @@ def get_pending_namespace(args): url="") -def handle_branch(cgh, pr, logs, args): +def handle_branch(cgh: GithubCachedClient, pr, logs, args): ns = get_pending_namespace(args) if args.pending else \ Namespace(commit=args.pr, status=args.status + "/error", @@ -477,7 +477,7 @@ def handle_branch(cgh, pr, logs, args): sys.exit(0) -def handle_pr_id(cgh, pr, logs, args): +def handle_pr_id(cgh: GithubCachedClient, pr, logs, args): commit = cgh.get("/repos/{repo_name}/commits/{ref}", repo_name=pr.repo_name, ref=pr.commit)