Improved modularity and readability of add_seo_descriptions.py by refactoring functions, enhancing block handling, and adding statistics saving. Updated auto-add-seo.yml to correctly detect changed markdown files using PR head and base SHAs for more accurate file selection.
Enhanced the detection and updating of SEO description blocks in add_seo_descriptions.py. The script now checks for the presence and non-emptiness of the Description field, and updates or inserts the SEO block as needed, handling invalid JSON gracefully.
Moved the SEO description generation logic from an inline script in the GitHub Actions workflow to a dedicated Python script at .github/scripts/add_seo_descriptions.py. Updated the workflow to call this script directly, improving maintainability and readability.