Skip to content

Commit

Permalink
Merge pull request #44 from camptocamp/skip-diff-bot-files
Browse files Browse the repository at this point in the history
PortAddonPullRequest: skip diff on auto-generated files
  • Loading branch information
sebalix authored Nov 2, 2023
2 parents 99f81c6 + c2e63ab commit 8dbef28
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions oca_port/port_addon_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"oca_dependencies.txt",
]

BOT_FILES_TO_SKIP = [
"README.rst",
"static/description/index.html",
]

# Fake PR for commits w/o any PR (used as fallback)
FAKE_PR = g.PullRequest(*[""] * 6)

Expand Down Expand Up @@ -290,6 +295,13 @@ def _skip_diff(commit, diff):
if diff.renamed:
return False, ""
diff_path = diff.b_path.split("/", maxsplit=1)[0]
# Skip diff updating auto-generated files (pre-commit, bot...)
if any(file_path in diff_path for file_path in BOT_FILES_TO_SKIP):
return (
True,
f"SKIP: '{diff.change_type} {diff.b_path}' diff relates "
"to an auto-generated file, skip to avoid conflict",
)
# Do not accept diff on unported addons
if (
not misc.get_manifest_path(diff_path)
Expand Down

0 comments on commit 8dbef28

Please sign in to comment.