From 759c0f213c966b4aee760ba10991a85e94208068 Mon Sep 17 00:00:00 2001 From: KB-perByte Date: Fri, 26 Jan 2024 10:29:50 +0530 Subject: [PATCH] ah fix --- src/ansiblelint/rules/galaxy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ansiblelint/rules/galaxy.py b/src/ansiblelint/rules/galaxy.py index 0679ad22de..d0ad04f49b 100644 --- a/src/ansiblelint/rules/galaxy.py +++ b/src/ansiblelint/rules/galaxy.py @@ -36,9 +36,9 @@ class GalaxyRule(AnsibleLintRule): def matchplay(self, file: Lintable, data: dict[str, Any]) -> list[MatchError]: """Return matches found for a specific play (entry in playbook).""" changelog_file_data = [] + global CHANGELOG_FILE if file.kind == "changelog": - global CHANGELOG_FILE - CHANGELOG_FILE = list(changelog_file_data.data.get("releases", None).keys()) + CHANGELOG_FILE = list(file.data.get("releases", None).keys()) if file.kind != "galaxy": # type: ignore[comparison-overlap] return [] @@ -101,7 +101,7 @@ def matchplay(self, file: Lintable, data: dict[str, Any]) -> list[MatchError]: ), ) else: - if Version(data.get("version")) != Version(changelog_file_data[-2]): + if Version(data.get("version")) != Version(changelog_file_data[-3]): results.append( self.create_matcherror( message="Version in galaxy.yaml and the latest version in changelog should be same.",