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

Add API tokens to secrets #158

Open
jtr13 opened this issue Nov 8, 2021 · 5 comments
Open

Add API tokens to secrets #158

jtr13 opened this issue Nov 8, 2021 · 5 comments

Comments

@jtr13
Copy link
Owner

jtr13 commented Nov 8, 2021

Chapters that require API tokens to build will not work unless we add the tokens to GitHub secrets and access them in GitHub actions. For now code chunks are set to eval=FALSE in https://jtr13.github.io/cc21fall2/scrape-twitter-data-using-r.html to circumvent this problem.

@rjr2168 developed a workflow for https://jtr13.github.io/cc21fall2/video-introduction-to-maps-with-ggmap.html using this method which we can use as a model if other authors are interested in going this route.

If you set eval=FALSE for other chapters for the same reason, please add a reference to those chapters in this thread.

@HannahFromAland
Copy link
Collaborator


Morning prof. Robbins. It seems in this chapter line 121-122 are still causing problems as yesterday...should we add eval = FALSE to all trunks in this chapter? 😿

@jtr13
Copy link
Owner Author

jtr13 commented Nov 8, 2021

Thanks for the heads-up. I already set eval=FALSE to the top of the document with knitr::opts_chunk$set(eval=FALSE) and am not completely sure why that's not having an effect. I'm trying now some other approaches to get the build to work.

@rjr2168
Copy link
Collaborator

rjr2168 commented Nov 8, 2021

Hello! I will try to do a write up of the exact modifications needed to make API keys work later today, if you decide to go that route. If you'd like an example of code modified from eval=FALSE to using API tokens, you can look in the history of my file and the .github/workflows/bookdown.yaml file to see what it entails. The only other modification made was the creation of a github secret.

@jtr13
Copy link
Owner Author

jtr13 commented Nov 8, 2021

Working again: https://github.com/jtr13/cc21fall2/actions/runs/1435105154 I had to add cache=FALSE in addition to eval=FALSE to knitr::opts_chunk$set(). Somehow the build was referencing old code for reasons that are not clear to me. Add cache=FALSE forces it to update all the code chunks.

@rjr2168
Copy link
Collaborator

rjr2168 commented Nov 8, 2021

As I mentioned earlier, I have made a brief discussion post detailing the process.

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

3 participants