Skip etc/packages.yml from backport: auto (#1437)

(cherry picked from commit d647c7b809)
This commit is contained in:
Ross Wolf
2021-08-18 16:55:21 -06:00
committed by github-actions[bot]
parent 94190321c1
commit c1b774cdb6
+9
View File
@@ -128,6 +128,10 @@ class GitChangeEntry:
@click.option("--dry-run", is_flag=True, help="List the changes that would be made")
def prune_staging_area(target_stack_version: str, dry_run: bool):
"""Prune the git staging area to remove changes to incompatible rules."""
exceptions = {
"etc/packages.yml",
}
target_stack_version = Version(target_stack_version)[:2]
# load a structured summary of the diff from git
@@ -138,6 +142,11 @@ def prune_staging_area(target_stack_version: str, dry_run: bool):
reversions: List[GitChangeEntry] = []
for change in changes:
if str(change.path) in exceptions:
# Don't backport any changes to files matching the list of exceptions
reversions.append(change)
continue
# it's a change to a rule file, load it and check the version
if str(change.path.absolute()).startswith(RULES_DIR) and change.path.suffix == ".toml":
# bypass TOML validation in case there were schema changes