Skip to content

Commit

Permalink
Pull request check: Get the ignore words file from the current ref
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jul 3, 2024
1 parent f881ab0 commit 6c39561
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions github_app_geo_project/module/pull_request/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6c39561

Please sign in to comment.