fix: add trailing newline to component_index.json (#12545)

The build_component_index.py script was generating component_index.json
without a trailing newline, causing CI failures when autofix.ci tried to
add the missing newline. This fix ensures the generated JSON file always
ends with a newline character, following POSIX text file standards.

Fixes the 'No newline at end of file' error in the update-component-index
workflow job.
This commit is contained in:
vjgit96
2026-04-07 15:22:36 -04:00
committed by GitHub
parent dbd31e0472
commit 4f9beebc00
3 changed files with 53 additions and 53 deletions

View File

@ -179,7 +179,7 @@ def main():
# Pretty-print for readable git diffs and resolvable merge conflicts
print(f"\nWriting formatted index to {output_path}")
json_bytes = orjson.dumps(index, option=orjson.OPT_SORT_KEYS | orjson.OPT_INDENT_2)
output_path.write_text(json_bytes.decode("utf-8"), encoding="utf-8")
output_path.write_text(json_bytes.decode("utf-8") + "\n", encoding="utf-8")
print("\nIndex successfully written!")
print(f" Version: {index['version']}")