From 6c395612e4aa9c033a2740480c2c2f7c1621af68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 3 Jul 2024 17:30:16 +0200 Subject: [PATCH] Pull request check: Get the ignore words file from the current ref --- github_app_geo_project/module/pull_request/checks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/github_app_geo_project/module/pull_request/checks.py b/github_app_geo_project/module/pull_request/checks.py index 4fd86c05ff..745b67376a 100644 --- a/github_app_geo_project/module/pull_request/checks.py +++ b/github_app_geo_project/module/pull_request/checks.py @@ -44,10 +44,12 @@ def _get_code_spell_command( ".spell-ignore-words.txt", ): try: - content = context.github_project.repo.get_contents(spell_ignore_file) + content = context.github_project.repo.get_contents( + spell_ignore_file, ref=context.event_data.get("pull_request", {}).get("head", {}).get("sha") + ) if isinstance(content, github.ContentFile.ContentFile): ignore_file.write(content.decoded_content.decode("utf-8")) - ignore_file.close() + ignore_file.flush() command.append(f"--ignore-words={ignore_file.name}") break except github.GithubException as exc: