2

I'm using a package to download data from a web api. Normally when I run this workflow I use environment variables to store the API credentials on my local machine.

library(scrobbler)

df <- download_scrobbles(Sys.getenv(LASTFM_API_USERNAME), Sys.getenv(LASTFM_API_KEY))

write.csv(df, "df.csv")

I'd like to set up this script to run on github actions. How can I setup this script to run on Actions in a way that I dont have to hardcode my API key into the script?

Conor Neilson
  • 1,026
  • 1
  • 11
  • 27
  • I think it may not be possible. In the call, GitHub hides the api key with `***` making it unrecognized by the server (not sure if someone found a solution, your best bet is to unfortunately hardcode the api key) – NelsonGon May 09 '21 at 03:09
  • 1
    How about using per-step `env` to "convert" secrets into environment variables? See [this answer](https://stackoverflow.com/a/59482124/11998612) for example. – Samira May 09 '21 at 07:21

0 Answers0