Skip to content

Commit 59d21ad

Browse files
committed
switching from REPO_USER_AND_PASS to more secure GH_TOKEN
1 parent ff3761c commit 59d21ad

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ Monst probably no change is required here.
9999

100100
## Extra
101101

102-
For your convenience, the addon will recognize the [environment variable](https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings) `REPO_USER_AND_PASS` and will replace this pattern in the `--repo` string. Please __do NOT disable the silent mode__ if you have credentials in the repository URL!
102+
For your convenience, the addon will recognize the [environment variable](https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings) `GH_TOKEN` and will replace this pattern in the `--repo` string. Please __do NOT disable the silent mode__ if you have credentials in the repository URL! Read more about [Github tokens here](https://help.github.com/articles/creating-an-access-token-for-command-line-use/).
103103

104104
In example, the following command runs [on our Travis-CI](https://travis-ci.org/Angular2Buch/book-monkey2):
105105

106106
```sh
107107
ng build --environment=production
108-
ng ghpages --repo=https://REPO_USER_AND_PASS@github.com/Angular2Buch/book-monkey2-public.git --name="The Buildbot" --email=[email protected]
108+
ng ghpages --repo=https://username:GH_TOKEN@github.com/organisation/your-repo.git --name="Displayed Username" --email=[email protected]
109109
```
110-
> REPO_USER_AND_PASS stores credentials in the format `username:password`. Special charcaters must be [percent-encoded](https://en.wikipedia.org/wiki/Percent-encoding).
110+
> GH_TOKEN is just like a password!
111111
112112
### A hint for angular-cli
113113

deploy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ module.exports = {
7070
}
7171

7272
// for your convenience - here you can hack credentials into the repository URL
73-
if (process.env.REPO_USER_AND_PASS && options.repo) {
74-
options.repo = options.repo.replace('REPO_USER_AND_PASS', process.env.REPO_USER_AND_PASS);
73+
if (process.env.GH_TOKEN && options.repo) {
74+
options.repo = options.repo.replace('GH_TOKEN', process.env.GH_TOKEN);
7575
}
7676

7777
// always clean the cache directory.

0 commit comments

Comments
 (0)