From 2056327ab459745dd7621bdfa1fe4175e44aa9a4 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Fri, 13 Dec 2024 08:02:03 -0600 Subject: [PATCH] fix: refresh before testing label (#3398) * fix: refresh before testing label * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- conda_forge_tick/events/pr_events.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/conda_forge_tick/events/pr_events.py b/conda_forge_tick/events/pr_events.py index ec00c2b13..1556ca9db 100644 --- a/conda_forge_tick/events/pr_events.py +++ b/conda_forge_tick/events/pr_events.py @@ -16,6 +16,17 @@ def _react_to_pr(uid: str, dry_run: bool = False) -> None: pr_json = LazyJson(f"pr_json/{uid}.json") with pr_json: + if pr_json.get("state", None) != "closed": + pr_data = refresh_pr(copy.deepcopy(pr_json.data), dry_run=dry_run) + if pr_data is not None: + if ( + "Last-Modified" in pr_json + and "Last-Modified" in pr_data + and pr_json["Last-Modified"] != pr_data["Last-Modified"] + ): + print("refreshed PR data", flush=True) + pr_json.update(pr_data) + if pr_json.get("state", None) != "closed": pr_data = close_out_labels(copy.deepcopy(pr_json.data), dry_run=dry_run) if pr_data is not None: