Skip to content

Commit 759c0f2

Browse files
committed
ah fix
1 parent 6107972 commit 759c0f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ansiblelint/rules/galaxy.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class GalaxyRule(AnsibleLintRule):
3636
def matchplay(self, file: Lintable, data: dict[str, Any]) -> list[MatchError]:
3737
"""Return matches found for a specific play (entry in playbook)."""
3838
changelog_file_data = []
39+
global CHANGELOG_FILE
3940
if file.kind == "changelog":
40-
global CHANGELOG_FILE
41-
CHANGELOG_FILE = list(changelog_file_data.data.get("releases", None).keys())
41+
CHANGELOG_FILE = list(file.data.get("releases", None).keys())
4242

4343
if file.kind != "galaxy": # type: ignore[comparison-overlap]
4444
return []
@@ -101,7 +101,7 @@ def matchplay(self, file: Lintable, data: dict[str, Any]) -> list[MatchError]:
101101
),
102102
)
103103
else:
104-
if Version(data.get("version")) != Version(changelog_file_data[-2]):
104+
if Version(data.get("version")) != Version(changelog_file_data[-3]):
105105
results.append(
106106
self.create_matcherror(
107107
message="Version in galaxy.yaml and the latest version in changelog should be same.",

0 commit comments

Comments
 (0)