From 9163e4bd2d5fe8e06760c0ae6d43a1eeb675b53f Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:33:33 +0100 Subject: [PATCH] ENH: remove redundant paths from requirements workflow (#275) --- src/compwa_policy/check_dev_files/update_pip_constraints.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compwa_policy/check_dev_files/update_pip_constraints.py b/src/compwa_policy/check_dev_files/update_pip_constraints.py index 623f9dd3..78801ef4 100644 --- a/src/compwa_policy/check_dev_files/update_pip_constraints.py +++ b/src/compwa_policy/check_dev_files/update_pip_constraints.py @@ -8,6 +8,7 @@ from __future__ import annotations import sys +from glob import glob from compwa_policy.check_dev_files.github_workflows import ( remove_workflow, @@ -71,7 +72,9 @@ def overwrite_workflow(workflow_file: str) -> None: if frequency == "outsource": del expected_data["on"]["schedule"] else: + paths: list[str] = expected_data["on"]["pull_request"]["paths"] expected_data["on"]["schedule"][0]["cron"] = _to_cron_schedule(frequency) + expected_data["on"]["pull_request"]["paths"] = [p for p in paths if glob(p)] workflow_path = CONFIG_PATH.github_workflow_dir / workflow_file if not workflow_path.exists(): update_workflow(yaml, expected_data, workflow_path)