Some of my package functions require a API setting a API key and I'd like to have those functions run on pkgdown, while not publicly exposing the API in my code. How do I enter a Github Secrets to my yaml?
I need to set the variable in R:
Sys.setenv(CENSUS_API_KEY = "ggrwewtw121312") # fake key
and suppose I have set a secret in on my Github, titled CENSUS_API_KEY
.
Then in my pkgdown yaml I currently tried
- name: Add CENSUS API KEY
run: |
Sys.setenv(CENSUS_API_KEY = {{ $secrets.CENSUS_API_KEY }})
shell: Rscript {0}
but that won't work because the {{$ }}
notation I guess cannot be used in R code. What is the right syntax?