Provide GITHUB_PAT to be used on Posit Connect when deploying with gh-actions

Hi,

I have a shiny app that I am deploying to Posit Connect using actions/connect-publish at main · rstudio/actions · GitHub

The app has a dependency in a form of a package on a private github repository.

The deployment fails because:

Error in downloadWithRetries(url, destfile = destfile): Failed to download package from GitHub URL: 'https://api.github.com/repos/.......'
Download failed.
If you are trying to restore a package from a private Git repo, you must have credentials available in your environment, and Packrat must be configured to use an auth-capable download method. GITHUB_PAT environment variable not found. Packrat is not configured to use an auth-capable download method. Try setting the option packrat.authenticated.downloads.use.renv to TRUE, or installing the httr package.

Is there any way to send a GITHUB_PAT to the connect server for packrat to use and to configure packrat to use an auth-capable download method?

Check out the Connect server configuration:
https://docs.posit.co/connect/admin/appendix/configuration/index.html#GitCredential

Hi

Thanks for the reply. I’ve seen that page but I couldn't find anything about GitHub actions. Am I missing something?

The deployment is initiated from GitHub Actions, but the environment restoration is running from the Connect server. Updating the server configuration with a GitCredential is what will enable it to call github with an API key.

1 Like

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.