@@ -76,18 +76,29 @@ Optionally, if you want to grant write access so `git-node` can write comments:
7676
7777You can also edit the permission of existing tokens later.
7878
79- After the token is generated, create an rc file with the following content:
80- (` ~/.ncurc ` or ` $XDG_CONFIG_HOME/ncurc ` ):
81-
82- ``` json
83- {
84- "username" : " your_github_username" ,
85- "token" : " token_that_you_created"
86- }
79+ After the token is generated, you can give it to NCU using:
80+
81+ <details open name =" set-token " ><summary >With encryption (Recommended)</summary >
82+
83+ ``` sh
84+ ncu-config set username your_github_username
85+ # Do not provide the token in the CLI, `ncu-config` will prompt you for it.
86+ ncu-config set -x token
87+ ```
88+
89+ Note: Encryption is available only if you have ` gpg ` setup on your machine.
90+
91+ </details >
92+
93+ <details name =" set-token " ><summary >Without encryption</summary >
94+
95+ ``` sh
96+ ncu-config set username your_github_username
97+ # Do not provide the token in the CLI, `ncu-config` will prompt you for it.
98+ ncu-config set token
8799```
88100
89- Note: you could use ` ncu-config ` to configure these variables, but it's not
90- recommended to leave your tokens in your command line history.
101+ </details >
91102
92103### Setting up Jenkins credentials
93104
@@ -108,27 +119,24 @@ To obtain the Jenkins API token
108119 ` ~/.ncurc.gpg ` or ` $XDG_CONFIG_HOME/ncurc.gpg ` ) with ` jenkins_token ` as key,
109120 like this:
110121
111- ``` json
112- {
113- "username" : " your_github_username" ,
114- "token" : " your_github_token" ,
115- "jenkins_token" : " your_jenkins_token"
116- }
122+ <details open name =" set-jenkins-token " ><summary >With encryption (recommended)</summary >
123+
124+ ``` sh
125+ ncu-config set -x jenkins_token
117126 ```
118127
119- ### Protecting your credentials
128+ Note: Encryption is available only if you have ` gpg ` setup on your machine.
120129
121- If you have ` gpg ` installed and setup on your local machine, it is strongly recommended
122- to store an encrypted version of this file:
130+ </details >
131+ <details name =" set-jenkins-token " ><summary >Without encryption</summary >
132+
133+ ``` sh
134+ ncu-config set jenkins_token
135+ ```
123136
124- ``` console
125- $ gpg --default-recipient-self --encrypt ~ /.ncurc
126- $ rm ~ /.ncurc
127- ```
137+ </details >
128138
129- The credentials are now encrypted in ` ~/.ncurc.gpg ` and everytime it's needed,
130- node-core-utils will invoke ` gpg ` that may ask you to decrypt it using
131- your default key via pinentry.
139+ ### Protecting your credentials
132140
133141Put the following entries into your
134142[ global ` gitignore ` file] ( https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreexcludesFile )
0 commit comments