File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,32 @@ $ ghtoken revoke \
302
302
204: Token revoked successfully
303
303
```
304
304
305
+ #### Integrate with [GitHub' s CLI](https://github.com/cli/cli)
306
+
307
+ You can use ghtoken alongside [gh cli](https://github.com/cli/cli) by setting these aliases:
308
+
309
+ ` ` ` sh
310
+ # Set a token generation alias. This will always generate a token from
311
+ # the app ID and key supplied.
312
+ $ gh alias set token -s ' ghtoken generate --key /tmp/private-key.pem --app_id 112233'
313
+
314
+ # Usage
315
+ $ gh token
316
+
317
+ {
318
+ " token" : " ghs_1gCKrYvkh3_______7JZFlZw______w1FE" ,
319
+ " expires_at" : " 2021-05-15T22:34:10Z"
320
+ }
321
+
322
+ # You can also set an alias to revoke tokens
323
+ $ gh alias set revokeToken -s ' ghtoken revoke --token "$1"'
324
+
325
+ # Usage
326
+ $ gh revokeToken " ghs_1gCKrYvkh3_______7JZFlZw______w1FE"
327
+
328
+ 204: Token revoked successfully
329
+ ` ` `
330
+
305
331
# ## Example in a workflow
306
332
307
333
1. You need to create a secret to store the ** applications private key** securely (this can be an organization or a repository secret):
You can’t perform that action at this time.
0 commit comments