OP here. On a hunch, even though my package is in a PUBLIC GitHub repo, I decided to log in to shinyapps.io and entered GitHub access credentials as if it were a private repo, as described here. This allowed the package build to work during Shiny app deployment.
I don't know if this would have happened with any public GitHub repo (because all other packages my Shiny app uses are on CRAN), but maybe it's a bug with accessing a public GitHub repo that you are also the owner of?
It is possible that shinyapps.io uses the GItHub API to download packages from GitHub, and gets rate-limited. In which case adding your token is the right solution indeed.
If this is indeed what's happening, if there is any way for RStudio to detect the specific failure cause, a more informative error message would be great.
We've identified an issue with installing GitHub packages on shinyapps.io. We're working on a fix and hope to resolve the issue soon. In the meantime, I can confirm that enabling GitHub Private Repo Access is a temporary workaround.
Is there a GitHub issue we can watch to know when this is fixed? I already have my GitHub account linked to either my personal shinyapps account or the DSLC.io account, so it won't let me enable GitHub authentication for an open-source org I also manage.
Would providing a GITHUB_TOKEN or GITHUB_PAT or something similar in .Renviron do the trick? I'll try that later, but thought I'd check before working on a fix later today!
This issue is being tracked internally, as the problem is related to an internal component. We've started working on a fix and hope to have it released next week.
Unfortunately, the only workaround right now is to enable private repo access. Including a PAT won't resolve the issue.