Brief description of the problem
When no lines exist in the latest section of NEWS.md, use_github_release() returns Error in text[[1]] : subscript out of bounds.
Reprex:
NEWS.md:
# pkg 0.2.0
# pkg 0.1.0
* news line
Code run:
The error occurs in news_latest() where code removing blank lines errors on an empty string.
This probably typically occurs because the user has taken usethis steps out of sequence, so the most sensible solution would be to stop with an informative error and advise the user to document the release in NEWS.md. Alternatively the function could pass the resulting newline and issue a warning advising the user to document their release when submitting the form on Github.
Happy to try a PR if you can indicate which solution you prefer.