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: README.md
+58-26Lines changed: 58 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,21 @@
1
1
# gh-seva
2
2
3
-
A GitHub `gh`[CLI](https://cli.github.com/) extension to list and create Secrets and Variables defined at an Organization level and/or Repository level.
A GitHub `gh`[CLI](https://cli.github.com/) extension to list and create Secrets and Variables
10
+
defined at an Organization level and/or Repository level.
4
11
5
12
## Installation
6
13
7
-
1. Install the `gh` CLI - see the [installation](https://github.com/cli/cli#installation) instructions.
14
+
1. Install the `gh` CLI - see the [installation](https://github.com/cli/cli#installation)
15
+
instructions.
8
16
9
17
2. Install the extension:
18
+
10
19
```sh
11
20
gh extension install katiem0/gh-seva
12
21
```
@@ -15,14 +24,16 @@ For more information: [`gh extension install`](https://cli.github.com/manual/gh_
15
24
16
25
## Usage
17
26
18
-
This extension supports listing and creating secrets and variables between `GitHub.com` and GitHub Enterprise Server, through the use of `--hostname` and `--source-hostname`.
27
+
This extension supports listing and creating secrets and variables between `GitHub.com` and
28
+
GitHub Enterprise Server, through the use of `--hostname` and `--source-hostname`.
29
+
30
+
If you are listing or creating org level secrets or variables, you'll need to ensure you
31
+
have logged in with the `admin:org` scope. To do so, run the following command:
19
32
20
-
If you are listing or creating org level secrets or variables, you'll need to ensure you have logged in with the `admin:org` scope. To do so, run the following command:
21
33
```sh
22
34
gh auth login -s admin:org
23
35
```
24
36
25
-
26
37
```sh
27
38
$ gh seva -h
28
39
Export and Create secrets and variables for an organization and/or repositories.
@@ -42,7 +53,8 @@ Use "seva [command] --help" for more information about a command.
42
53
43
54
### Secrets
44
55
45
-
The `gh seva secrets` command comprises of two subcommands, `export` and `create`, to access and create Organization level and repository level secrets.
56
+
The `gh seva secrets` command comprises of two subcommands, `export` and `create`, to access
57
+
and create Organization level and repository level secrets.
46
58
47
59
```sh
48
60
$ gh seva secrets -h
@@ -63,15 +75,19 @@ Use "seva secrets [command] --help" for more information about a command.
63
75
64
76
#### Create Secrets
65
77
66
-
The `gh seva secrets create` command will create secrets from a `csv` file that contains the following information:
78
+
The `gh seva secrets create` command will create secrets from a `csv` file that contains
79
+
the following information:
67
80
68
81
-`SecretLevel`: If the secret was created at the organization or repository level
69
82
-`SecretType`: If the secret was created for `Actions`, `Dependabot` or `Codespaces`
70
83
-`SecretName`: The name of the secret
71
-
-`SecretValue`: The value of the secret that will be [encrypted using the associated `public key`](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
72
-
-`SecretAccess`: If an organization level secret, the visibility of the secret (i.e. `all`, `private`, or `scoped`)
73
-
-`RepositoryNames`: The name of the repositories that the secret can be accessed from (delimited with `;`)
74
-
-`RepositoryIDs`: The `id` of the repositories that the secret can be accessed from (delimited with `;`)
84
+
-`SecretValue`: The value of the secret that will be [encrypted using the associated `public key`](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
85
+
-`SecretAccess`: If an organization level secret, the visibility of the secret
86
+
(i.e. `all`, `private`, or `scoped`)
87
+
-`RepositoryNames`: The name of the repositories that the secret can be accessed
88
+
from (delimited with `;`)
89
+
-`RepositoryIDs`: The `id` of the repositories that the secret can be accessed
90
+
from (delimited with `;`)
75
91
76
92
This extension supports `GitHub.com` and GHES, through the use of `--hostname` and `--token`.
77
93
@@ -94,15 +110,21 @@ Global Flags:
94
110
95
111
#### Export Secrets
96
112
97
-
The `gh seva secrets export` command exports secrets for the specified `<organization>` or `[repo ..]` list. If `<organization>` is selected, **both organization level and repository level secrets will be exported**. The report will contain secrets produces a `csv` report with the following:
113
+
The `gh seva secrets export` command exports secrets for the specified `<organization>`
114
+
or `[repo ..]` list. If `<organization>` is selected, **both organization level and repository
115
+
level secrets will be exported**. The report will contain secrets produces a `csv` report
116
+
with the following:
98
117
99
118
-`SecretLevel`: If the secret was created at the organization or repository level
100
119
-`SecretType`: If the secret was created for `Actions`, `Dependabot` or `Codespaces`
101
120
-`SecretName`: The name of the secret
102
-
-`SecretValue`: This field **will be blank**, we cannot export secret values.
103
-
-`SecretAccess`: If an organization level secret, this is the visibility of the secret (i.e. `all`, `private`, or `scoped`)
104
-
-`RepositoryNames`: The name of the repositories that the secret can be accessed from (delimited with `;`)
105
-
-`RepositoryIDs`: The `id` of the repositories that the secret can be accessed from (delimited with `;`)
121
+
-`SecretValue`: This field **will be blank**, we cannot export secret values.
122
+
-`SecretAccess`: If an organization level secret, this is the visibility of the secret
123
+
(i.e. `all`, `private`, or `scoped`)
124
+
-`RepositoryNames`: The name of the repositories that the secret can be accessed from
125
+
(delimited with `;`)
126
+
-`RepositoryIDs`: The `id` of the repositories that the secret can be accessed from
127
+
(delimited with `;`)
106
128
107
129
This extension supports `GitHub.com` and GHES, through the use of `--hostname` and `--token`.
108
130
@@ -131,10 +153,12 @@ Organization level Actions variables can be created and exported, relying on the
131
153
-`VariableLevel`: If the variable was created at the organization or repository level
132
154
-`VariableName`: The name of the Actions variable
133
155
-`VariableValue`: The value of the Actions variable
134
-
-`VariableAccess`: If an organization level variable, this is the visibility of the variable (i.e. `all`, `private`, or `scoped`)
135
-
-`RepositoryNames`: The name of the repositories that the variable can be accessed from (delimited with `;`)
136
-
-`RepositoryIDs`: The `id` of the repositories that the variable can be accessed from (delimited with `;`)
137
-
156
+
-`VariableAccess`: If an organization level variable, this is the visibility of the
157
+
variable (i.e. `all`, `private`, or `scoped`)
158
+
-`RepositoryNames`: The name of the repositories that the variable can be accessed
159
+
from (delimited with `;`)
160
+
-`RepositoryIDs`: The `id` of the repositories that the variable can be accessed
161
+
from (delimited with `;`)
138
162
139
163
```sh
140
164
$ gh seva variables -h
@@ -155,9 +179,11 @@ Use "seva variables [command] --help" for more information about a command.
155
179
156
180
#### Create Variables
157
181
158
-
Organization level variables can be created from a `csv` file using `--from-file` following the format outlined in [`gh seva variables`](#variables).
182
+
Organization level variables can be created from a `csv` file using `--from-file` following the
183
+
format outlined in [`gh seva variables`](#variables).
159
184
160
-
* If specifying a Source Organization (`--source-organization`) to retrieve variables and create under a new Org, the `--source-token` is required.
185
+
- If specifying a Source Organization (`--source-organization`) to retrieve variables and
186
+
create under a new Org, the `--source-token` is required.
161
187
162
188
```sh
163
189
$ gh seva variables create -h
@@ -182,14 +208,20 @@ Global Flags:
182
208
183
209
#### Export Variables
184
210
185
-
The `gh seva variables export` command exports variables for the specified `<organization>` or `[repo ..]` list. If `<organization>` is selected, **both organization level and repository level variables will be exported**. The report will contain variables produces a `csv` report with the following:
211
+
The `gh seva variables export` command exports variables for the specified `<organization>`
212
+
or `[repo ..]` list. If `<organization>` is selected, **both organization level and repository
213
+
level variables will be exported**. The report will contain variables produces a `csv` report
214
+
with the following:
186
215
187
216
-`VariableLevel`: If the variable was created at the organization or repository level
188
217
-`VariableName`: The name of the Actions variable
189
218
-`VariableValue`: The value of the Actions variable
190
-
-`VariableAccess`: If an organization level variable, this is the visibility of the variable (i.e. `all`, `private`, or `scoped`)
191
-
-`RepositoryNames`: The name of the repositories that the variable can be accessed from (delimited with `;`)
192
-
-`RepositoryIDs`: The `id` of the repositories that the variable can be accessed from (delimited with `;`)
219
+
-`VariableAccess`: If an organization level variable, this is the visibility of the variable
220
+
(i.e. `all`, `private`, or `scoped`)
221
+
-`RepositoryNames`: The name of the repositories that the variable can be accessed from
222
+
(delimited with `;`)
223
+
-`RepositoryIDs`: The `id` of the repositories that the variable can be accessed from
224
+
(delimited with `;`)
193
225
194
226
This extension supports `GitHub.com` and GHES, through the use of `--hostname` and `--token`.
0 commit comments