If a line starting with `*` (app entry) appears before any category header (`### •` or `## –`), `categories[-1]` will raise an `IndexError` because the `categories` list will be empty. A malformed or tampered README.md could cause the CI script to crash with an unhandled exception.
Affected files: ensure_sorted.py
Signed-off-by: Trần Bách <45133811+barttran2k@users.noreply.github.com>
The `README.md` file is opened using `open('README.md', 'r')` but is never explicitly closed. This can lead to resource leaks, especially in long-running processes or if the script were to be extended to open many files. While Python's garbage collector might eventually close it, it's not guaranteed and is considered bad practice.
Affected files: ensure_sorted.py
Signed-off-by: toanmap <174589430+maptoan@users.noreply.github.com>