Hello! I have a pretty weird and niche question and I haven't been able to figure things out and would appreciate any insights anyone has to offer here.
I recently figured out how to use GitHub actions in R, and I created a quick-start guide to a database I own using bookdown, and I am looking to have it automatically refresh once a day in order to show a data preview of each table for the current day instead of showing older data in that preview.
I did a lot of playing around with GitHub actions and I was able to pass a secret string that is saved in the repository settings to a .Rmd file and things seemed to work fine, but now that I am doing the same thing to my bookdown project to pass the database login information, it is not able to find the variable that I assign the secret string to:
That was a great idea! Definitely should have thought of that myself and I thought it was promising, but unfortunately I'm still running into the same issue:
Thoughts on how to get it to work with bookdown::render_book()? If I change the one line it can't find the variable db_user and using the ${{secrets.USER}} syntax doesn't work directly in the .Rmd file
If I pull directly from the same repository and run the same command locally with the values that the secrets are hiding this works as expected:
By default in a non interactive session bookdown::render_book() will clean the environment before rendering. You could try running as bookdown::render_book(..., clean_envir = FALSE)
After adding , clean_envir = FALSE to my code everything finally works!