'R packages in private organization - how to install private dependencies within organization?

Our GitHub organization is private and is developing multiple private R packages within multiple different repositories in our organization. Some of these packages have dependencies on other repositories in our private organization. How can I set up GitHub actions to be able to install these private dependencies? My description file currently contains:

Imports:
    MyPackageDep
Remotes:
    MyOrg/MyPackageDep

The relevant portion of my GitHub Actions .yaml is:

  - name: Install dependencies
    run: |
      remotes::install_deps(dependencies = TRUE)
      remotes::install_cran("rcmdcheck")
    shell: Rscript {0}

I tried following the advice of this SO post by storing my PAT in an .Renviron file. But not only does this still not work, I still am not sure how this would work with multiple contributors to the package. Would they all just need to set up their own local GITHUB_PAT in their own .Renviron?

I also tried following the advice of this GitHub issue by including the following in my GitHub workflow:

 env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

The workflow still failed to download the dependency.

Is there anyway with GitHub Secrets to pre-configure the repository to have access to all other private repositories in an organization?



Solution 1:[1]

Most of the IT companies using "Rstudio Package Manager" for security purpose. And due to this we can not able to install other packages in office laptop/System. I tried few things and thats works for me.

I think this solution will help you. Please look into this answer and try this. https://stackoverflow.com/a/70875212/10574296

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user229044