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
Copy file name to clipboardExpand all lines: vignettes/multideploy.Rmd
+22-32Lines changed: 22 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -17,33 +17,33 @@ knitr::opts_chunk$set(
17
17
18
18
## Introduction
19
19
20
-
The `multideploy` package provides a streamlined way to deploy file changes
20
+
The `{multideploy}` package provides a streamlined way to deploy file changes
21
21
across multiple GitHub repositories. Whether you're managing standardized CI/CD
22
22
configurations, common utility scripts, code style definitions, or any other
23
-
files that should be consistent across repositories, `multideploy` helps
23
+
files that should be consistent across repositories, `{multideploy}` helps
24
24
automate this process.
25
25
26
26
This vignette will guide you through the main functionality of the package with
27
27
practical examples.
28
28
29
29
## Setup and Authentication
30
30
31
-
First, load the multideploy package:
31
+
First, load the `{multideploy}` package:
32
32
33
33
```{r}
34
-
#| label: setup
34
+
#| label: setup-vignette
35
35
#| eval: FALSE
36
36
library(multideploy)
37
37
```
38
38
39
-
Before using `multideploy`, you need to authenticate with GitHub. The package
39
+
Before using `{multideploy}`, you need to authenticate with GitHub. The package
40
40
uses the [`gh`](https://github.com/r-lib/gh) package for authentication, which
41
41
looks for a [GitHub Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) in the `GITHUB_PAT` or
42
42
`GITHUB_TOKEN` environment variables. This token can be set directly within the
43
43
R script via:
44
44
45
45
```{r}
46
-
#| label: auth
46
+
#| label: auth-session-vignette
47
47
#| eval: FALSE
48
48
# Set GitHub PAT (or better, use .Renviron)
49
49
Sys.setenv(GITHUB_PAT = askpass::askpass("What is your GitHub Personal Access Token (PAT) ?"))
@@ -52,22 +52,12 @@ Sys.setenv(GITHUB_PAT = askpass::askpass("What is your GitHub Personal Access To
52
52
For regular use, it's recommended to add your PAT to the git credential system
53
53
through the `gitcreds` package:
54
54
55
-
```r
55
+
```{r}
56
+
#| label: auth-credentials-vignette
57
+
#| eval: false
56
58
gitcreds::gitcreds_set()
57
59
```
58
60
59
-
Alternatively, you can set the PAT directly in your `.Renviron` file by running:
60
-
61
-
```r
62
-
file.edit("~/.Renviron")
63
-
```
64
-
65
-
Then, type:
66
-
67
-
```bash
68
-
GITHUB_PAT=your_github_pat_here
69
-
```
70
-
71
61
Your PAT needs appropriate permissions to access and modify repositories.
72
62
At a minimum, you'll need:
73
63
@@ -81,7 +71,7 @@ At a minimum, you'll need:
81
71
The `repos()` function allows you to list repositories for a user or organization:
82
72
83
73
```{r}
84
-
#| label: repos
74
+
#| label: repos-list-vignette
85
75
#| eval: FALSE
86
76
# List repositories for a user
87
77
user_repos <- repos("username")
@@ -101,7 +91,7 @@ head(api_repos)
101
91
If you're a member of multiple organizations, you can list them with:
102
92
103
93
```{r orgs}
104
-
#| label: orgs
94
+
#| label: orgs-list-vignette
105
95
#| eval: FALSE
106
96
my_orgs <- orgs()
107
97
print(my_orgs)
@@ -114,7 +104,7 @@ print(my_orgs)
114
104
You can retrieve the content of a file from a GitHub repository:
0 commit comments