Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring a local package for bookdown workflow #443

Closed
dchiu911 opened this issue Nov 24, 2021 · 4 comments
Closed

Restoring a local package for bookdown workflow #443

dchiu911 opened this issue Nov 24, 2021 · 4 comments

Comments

@dchiu911
Copy link

@dchiu911 dchiu911 commented Nov 24, 2021

Is it possible to pass RENV_PATHS_LOCAL to the r-lib/actions/examples/bookdown.yml workflow so that I can restore a local package when trying to reproduce the report using github actions?

Otherwise I am hitting this error because my .Renviron with the RENV_PATHS_LOCAL field is not being passed:

Error: Error: failed to retrieve package 'localPackage'
@gaborcsardi
Copy link
Contributor

@gaborcsardi gaborcsardi commented Dec 10, 2021

You can set environment variables for all steps or for a single step of an action, here is an example:

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
See the GitHub Actions documentation for details.

@dchiu911
Copy link
Author

@dchiu911 dchiu911 commented Dec 11, 2021

Thanks @gaborcsardi I've tried the following configs and each time I get the same error

    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
      RENV_PATHS_LOCAL: ~/Packages
      - name: renv local
        shell: bash
        run: |
          echo "RENV_PATHS_LOCAL=~/Packages" >> $GITHUB_ENV

@gaborcsardi
Copy link
Contributor

@gaborcsardi gaborcsardi commented Dec 11, 2021

Make sure you set the env var globally, if you set it in one step, it will not be available in other steps. Make sure that it is set correctly, just by printing it out. Otherwise if it is set correctly and this is the env var you are supposed to set, I am not sure what is wrong, but you can ask renv related questions at https://community.rstudio.com/tag/renv Make sure you use the renv tag.

@dchiu911
Copy link
Author

@dchiu911 dchiu911 commented Dec 13, 2021

Pretty sure I set them globally:

jobs:
  bookdown:
    runs-on: ubuntu-latest
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
      RENV_PATHS_LOCAL: ~/Packages
    steps:

I'll ask in Community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants