Skip to content

Commit

Permalink
Merge pull request #418 from camptocamp/fix
Browse files Browse the repository at this point in the history
Changelog: Avoid that a release creation trigger many runs
  • Loading branch information
sbrunner authored Jul 3, 2024
2 parents f7351ff + 6c39561 commit 5fc9c79
Show file tree
Hide file tree
Showing 2 changed files with 5 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
1 change: 1 addition & 0 deletions github_app_geo_project/module/standard/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def get_actions(self, context: module.GetActionContext) -> list[module.Action[di
)
and event_data.get("pull_request", {}).get("state") == "closed"
and event_data.get("pull_request", {}).get("milestone")
and event_data.get("sender", {}).get("login") != context.github_application.name + "[bot]"
):
return [module.Action(priority=module.PRIORITY_CRON, data={"type": "pull_request"})]
if event_data.get("action") == "edited" and "milestone" in event_data:
Expand Down

0 comments on commit 5fc9c79

Please sign in to comment.