From 459e7fa63d6a4ab08292bb44177a1c2343d9c1aa Mon Sep 17 00:00:00 2001 From: Maciej Banas Date: Mon, 25 Sep 2023 09:52:35 +0000 Subject: [PATCH] Update docs. --- README.Rmd | 7 +++++++ README.md | 8 ++++++++ vignettes/gitstats_workflow.Rmd | 6 +++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.Rmd b/README.Rmd index 60c105cb..572fcc8f 100644 --- a/README.Rmd +++ b/README.Rmd @@ -33,6 +33,13 @@ devtools::install_github("r-world-devs/GitStats") Please remember to have your access tokens stored as environment variables: `GITHUB_PAT` for access to GitHub API and `GITLAB_PAT` for GitLab API. +### Scope of tokens + +In the spirit of good practice of setting minimal scope of access to tokens for `GitStats` to work you need: + +- [GitHub] `public_repo` and `read:user` scopes, +- [GitLab] `read_api` scope. + ## GitStats workflow On how to use GitStats, refer to the [documentation](placeholder for a link to docs). diff --git a/README.md b/README.md index 428eda34..135f48f5 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,14 @@ Please remember to have your access tokens stored as environment variables: `GITHUB_PAT` for access to GitHub API and `GITLAB_PAT` for GitLab API. +### Scope of tokens + +In the spirit of good practice of setting minimal scope of access to +tokens for `GitStats` to work you need: + +- \[GitHub\] `public_repo` and `read:user` scopes, +- \[GitLab\] `read_api` scope. + ## GitStats workflow On how to use GitStats, refer to the diff --git a/vignettes/gitstats_workflow.Rmd b/vignettes/gitstats_workflow.Rmd index e0e6eb3f..a74a2ffe 100644 --- a/vignettes/gitstats_workflow.Rmd +++ b/vignettes/gitstats_workflow.Rmd @@ -38,7 +38,7 @@ git_stats <- create_gitstats() %>% If you have your token environment variables stored in `GITHUB_PAT` or `GITHUB_PAT_*` and `GITLAB_PAT` or `GITLAB_PAT_*` you do not need to specify them in `set_host()` function, `GitStats` will automatically find them. -```{r} +```{r, eval = FALSE} git_stats <- create_gitstats() %>% set_host( api_url = "https://api.github.com", @@ -96,13 +96,13 @@ gitstats_plot( If you work with interactive app, you can use a `plotly_mode`. -```r +```{r} gitstats_plot(repos_stats, plotly_mode = TRUE) ``` ## Commits workflow -It is basically very simillar to the repositories one, but you should specify additionally at least `date_from` parameter. +It is basically very similar to the repositories one, but you should specify additionally at least `date_from` parameter. ```{r, message = FALSE} pull_commits(