TL;DR
I just released generate-sitemap 1.10.0, a GitHub Action for generating XML sitemaps for static websites. The generate-sitemap GitHub Action is implemented in Python, and generates an XML sitemap by crawling the GitHub repository containing the html of the site, using commit dates to generate <lastmod> tags in the sitemap.
This release, generate-sitemap 1.10.0, introduces an option to specify a list of directories and/or individual files to exclude from the sitemap. The Action already automatically excluded individual html files from the sitemap if a noindex directive to robots was specified in the head of the page, as well as exclusions based on contents of the site's robots.txt. This release adds the ability to specify additional paths to exclude from the sitemap. The motivating case came from a feature request from a user who wanted to be able to exclude a directory of content common across multiple pages from the sitemap (e.g., the pages that depend upon that content should be in sitemap, but not necessarily the shared html).
Changelog 1.10.0 - 2023-11-15
Added
- Ability to specify list of paths to exclude from sitemap, via new input
exclude-paths.
Dependencies
More Information
Please consider starring generate-sitemap's GitHub repository:
Generate an XML sitemap for a GitHub Pages site using GitHub Actions
For more information, see my earlier post about generate-sitemap here on DEV, as well as its webpage.
The generate-sitemap GitHub action generates a sitemap for a website hosted on GitHub Pages. Supports both xml and txt sitemaps. Uses the last commit date of each file to generate the lastmod tags in XML sitemaps. Parses robots.txt and scans html files for noindex directives, excluding URLs if noindex directives or disallows found.

actions.cicirello.org
Where You Can Find Me
Follow me here on DEV and on GitHub:
Or visit my website:
Vincent A. Cicirello - Professor of Computer Science at Stockton University - is a
researcher in artificial intelligence, evolutionary computation, swarm intelligence,
and computational intelligence, with a Ph.D. in Robotics from Carnegie Mellon
University. He is an ACM Senior Member, IEEE Senior Member, AAAI Life Member,
EAI Distinguished Member, and SIAM Member.

cicirello.org