Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,30 @@ $ gem install travis
$ travis encrypt -r username/reponame GH_TOKEN=[the token you created before] --add
```

*Except the above two solution, another online yet easy way:*
Go directly to : https://npm.runkit.com/travis-encrypt Run the code like this, we will get the encrpted value by the `console.log`
```javascript
var encrypt = require('travis-encrypt');
encrypt({
repo: 'pwmckenna/node-travis-encrypt',
data: 'EXAMPLE_ENV_VARIABLE=asdf'
}, function (err, blob) {
// do something with the encrypted data blob...
});

// also supports encrypting for private travis pro repos,
// though it needs your github credentials to login to travis pro.
encrypt({
repo: 'pwmckenna/private-repo',
data: 'EXAMPLE_ENV_VARIABLE=asdf',
username: 'username',
password: 'password'
}, function (err, blob) {
// do something with the encrypted data blob...
console.log(blob)
});
```

Note: that I put some spaces before the `travis` command. If you have `bash` configured in
this common way, this makes sure the command doesn't end up in your Bash History.
Can't be too safe with those tokens.
Expand Down