Skip to content

Commit ba8dedd

Browse files
committed
ci/check: Replace attribute with spec version
Fixes: #612
1 parent bc7be3a commit ba8dedd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ci/check.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ def handle_error(e):
5555
os.path.join('ssh-key.pub'): 'ssh-rsa AAAAB',
5656
}
5757

58+
# Get spec version from antora.yml
59+
with open("antora.yml", encoding="utf-8") as stream:
60+
try:
61+
antora = yaml.safe_load(stream)
62+
except yaml.YAMLError as exc:
63+
print(exc)
64+
butane_latest_spec = antora.get("asciidoc").get("attributes").get("butane-latest-stable-spec")
65+
5866
ret = 0
5967
with tempfile.TemporaryDirectory() as tmpdocs:
6068
for path, contents in tmpfiles.items():
@@ -72,6 +80,7 @@ def handle_error(e):
7280
# Iterate over YAML source blocks
7381
for match in matcher.finditer(filedata):
7482
bu = match.group(1)
83+
bu = bu.replace('{butane-latest-stable-spec}', butane_latest_spec)
7584
buline = filedata.count('\n', 0, match.start(1)) + 1
7685
if not bu.startswith('variant:'):
7786
print(f'{WARN}Ignoring non-Butane YAML at {filepath}:{buline}{RESET}')

0 commit comments

Comments
 (0)