You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to setup a GitHub action to automate some steps using easyPubMed. I am facing some challenges with accessing the GitHub secret containing the environment variable for the PubMed API key.
Using Sys.getenv("API_TOKEN_PUBMED") will provide an empty string ("") if it cannot find it. If batch_pubmed_download() is provided this empty string in the api_key argument, it will get stuck in an infinite loop (Killing the request! Something is not working. Please, try again later), which is harder to debug from GitHub actions since we cannot see this message from a rendered rmarkdown file.
My suggestion is to error if api_key is empty:
if (`api_key`=="") stop("api_key cannot be an empty string.")
Reprex:
library(easyPubMed)
ml_query<-"Machine Learning[TI] AND 2016[PD]"out1<- batch_pubmed_download(pubmed_query_string=ml_query, batch_size=500, api_key="")
#> Killing the request! Something is not working. Please, try again later#> Killing the request! Something is not working. Please, try again later#> Killing the request! Something is not working. Please, try again later
[...]
#> Killing the request! Something is not working. Please, try again later
The text was updated successfully, but these errors were encountered:
I am trying to setup a GitHub action to automate some steps using
easyPubMed
. I am facing some challenges with accessing the GitHub secret containing the environment variable for the PubMed API key.Using
Sys.getenv("API_TOKEN_PUBMED")
will provide an empty string ("") if it cannot find it. Ifbatch_pubmed_download()
is provided this empty string in theapi_key
argument, it will get stuck in an infinite loop (Killing the request! Something is not working. Please, try again later
), which is harder to debug from GitHub actions since we cannot see this message from a rendered rmarkdown file.My suggestion is to error if
api_key
is empty:Reprex:
The text was updated successfully, but these errors were encountered: