(solved) github actions fail due to invalid URL checks

Good afternoon, I am trying to fix build errors from my package. When I run R CMD check --as-cran on my package tarball in preparation of a CRAN package update I receive the warning:

 Package has help file(s) containing install/render-stage \Sexpr{} expressions but no prebuilt PDF manual.
   
   Found the following (possibly) invalid URLs:
     URL: <https://aqs.epa.gov/aqsweb/documents/data_api.html>
       From: man/RAQSAPI.Rd
       Message: Invalid URI scheme
     URL: <https://github.com/USEPA/RAQSAPI>
       From: man/RAQSAPI.Rd
       Message: Invalid URI scheme

Now normally this would not be a problem except now it is affecting the github badges for package build on my repository. Since WARNINGS are upgraded to ERRORS by badge is the build is failing, instead of passing. I could attempt to get my action to not do this but that circumvents to real underlying issue. I have tried the urlchecker package to fix the issue, but urlchecker just returns this without fixing the issue:

urlchecker::url_update()
✖ Error: man/RAQSAPI.Rd:41:14 : Invalid URI scheme
  \item \url{<https://aqs.epa.gov/aqsweb/documents/data_api.html>}
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
✖ Error: man/RAQSAPI.Rd:40:14 : Invalid URI scheme
  \item \url{<https://github.com/USEPA/RAQSAPI>}
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am not sure why both tools::checkrd and urlchecker is throwing this invalid URI scheme warning. Is there anyway to fix this issue without turning off the ability to promote warnings into errors during package checks?

Maybe try dropping the < and > characters?

1 Like

Thanks, if my memory serves me correct, a few years ago during my first package submission to CRAN, I was told that all URLs need to be surrounded by angled brackets by one of the CRAN reviewers. Did that policy change or did I misinterpret something they said?

Yes, brackets should be used in the Description field in the DESCRIPTION file. But seems like not in the URL field or in the \url{} macro in the documentation.

1 Like

That is weird. Something must have changed. I have not changed those urls, at least I don't remember changing them in a long time. I never received those errors before.

Thanks that worked. :grinning:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.