gh-actions for r-cmd-check on package on private repository

Hi,

I tried checking out the forum before writing but don't seem to be able to find a solution, so here is my question.

I have a package on private repository that imports another package from a private repository in the same organization (myorg/pak1 and myorg/pak2).

I can verify that both packages can be installed from Rstudio, and devtools::check() runs without errors. I have the package correctly put in the DESCRIPTION file in Imports and Remotes.

I am now trying to use the r-cmd-check.yaml, with usethis:

on:
  push:
    branches: [main, master]
  pull_request:
    branches: [main, master]

name: R-CMD-check

jobs:
  R-CMD-check:
    runs-on: ubuntu-latest
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
      R_KEEP_PKG_SOURCE: yes
    steps:
      - uses: actions/checkout@v2

      - uses: r-lib/actions/setup-r@v1
        with:
          use-public-rspm: true

      - uses: r-lib/actions/setup-r-dependencies@v1
        with:
          extra-packages: rcmdcheck

      - uses: r-lib/actions/check-r-package@v1

The workflow fails in setup-r-dependencies:

Run r-lib/actions/setup-r-dependencies@v1
  with:
    extra-packages: rcmdcheck
    cache-version: 1
    pak-version: stable
  env:
    GITHUB_PAT: ***
    R_KEEP_PKG_SOURCE: yes
    R_LIBS_USER: /home/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    RSPM: https://packagemanager.rstudio.com/all/__linux__/focal/latest
Run cat("::group::Install pak\n")
Install pak
  Installing package into ‘/home/runner/work/_temp/Library’
  (as ‘lib’ is unspecified)
  trying URL 'https://r-lib.github.io/p/pak/stable/src/contrib/../../linux/x86_64/pak_0.3.0_R-4-2_x86_64-linux.tar.gz'
  Content type 'application/gzip' length 7623616 bytes (7.3 MB)
  ==================================================
  downloaded 7.3 MB
  
  * installing *binary* package ‘pak’ ...
  * DONE (pak)
  
  The downloaded source packages are in
  	‘/tmp/RtmpW9II9G/downloaded_packages’
  
  ✔ Updated metadata database: 3.28 MB in 7 files.
  
  ℹ Updating metadata database
  ✔ Updating metadata database ... done
  
  
  Error: Error: <callr_remote_error: Cannot install packages:
  * local::.: Can't install dependency myorg/pak2
  * myorg/pak2: Can't find GitHub repo myorg/pak2.>
   in process 8643 
  -->
  <simpleError: Cannot install packages:
  * local::.: Can't install dependency myorg/pak2
  * myorg/pak2: Can't find GitHub repo myorg/pak2.>
  
   Stack trace:
  
   12. (function (...)  ...
   13. base:::withCallingHandlers(cli_message = function(msg) { ...
   14. get("pkg_deps_internal", asNamespace("pak"))(...)
   15. pak:::pkg_deps_internal2(pkg, upgrade, dependencies)
   16. deps$stop_for_solution_error()
   17. private$plan$stop_for_solve_error()
   18. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
   19. base:::stop("Cannot install packages:\n", msg, call. = FALSE)
   20. base:::.handleSimpleError(function (e)  ...
   21. h(simpleError(msg, call))
   22. base:::stop(e)
   23. (function (e)  ...
  
   x Cannot install packages:
  * local::.: Can't install dependency myorg/pak2
  * myorg/pak2: Can't find GitHub repo myorg/pak2. 
  
  Execution halted
  Error: Process completed with exit code 1.

I am not sure what I am missing or doing wrong. I have a github token which I presume is being loaded correctly in env:. I tried some things like installing the package explicitly with remotes but regardless I keep getting the same error.

Thanks for any hints.

1 Like

This topic was automatically closed 21 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.