From c2e63ab3f0fecdc29efa1e66d01c4e59ad2d0693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alix?= Date: Thu, 2 Nov 2023 15:17:27 +0100 Subject: [PATCH] PortAddonPullRequest: skip diff on auto-generated files --- oca_port/port_addon_pr.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/oca_port/port_addon_pr.py b/oca_port/port_addon_pr.py index 7981693..7173f03 100644 --- a/oca_port/port_addon_pr.py +++ b/oca_port/port_addon_pr.py @@ -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) @@ -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)