build: reject non-matching artifacts

Check for malformed artifact names before dereferencing them.

Fixes: 5816d883ff
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22385
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Eric Fahlgren 2026-03-11 13:16:34 -07:00 committed by Robert Marko
parent 48b8ff890b
commit 1f30a3288d

View file

@ -36,8 +36,9 @@ def add_artifact(artifact, prefix="openwrt-"):
output[artifact] = {}
for file in files:
file = str(file.name)
arch = re.match(r".*Linux-([^.]*)\.", file).group(1)
output[artifact][arch] = file
arch = re.match(r".*Linux-([^.]*)\.", file)
if arch:
output[artifact][arch.group(1)] = file
for json_file in work_dir.glob("*.json"):