Skip to content

Instantly share code, notes, and snippets.

@topheman
Created August 4, 2015 18:49
Show Gist options
  • Save topheman/25241e48a1b4f91ec6d4 to your computer and use it in GitHub Desktop.
Save topheman/25241e48a1b4f91ec6d4 to your computer and use it in GitHub Desktop.
Travis setup of Github token for jspm

If you encounter the following:

GitHub rate limit reached. To increase the limit use GitHub authentication.
     Run jspm endpoint config github to set this up.

Sources :

  1. go to https://github.com/settings/tokens

  2. Create a token , label it "Travis"

  3. Copy paste the token

  4. jspm registry config github

You'll be asked for the token

  1. jspm registry export github

outputs:

jspm config registries.github.remote https://github.jspm.io
jspm config registries.github.auth JSPM_GITHUB_AUTH_TOKEN
jspm config registries.github.maxRepoSize 100
jspm config registries.github.handler jspm-github

JSPM_GITHUB_AUTH_TOKEN: unencrypted Base64 encoding of your GitHub username and password or access token

  1. Install travis-cli
$ ruby -v
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
$ gem install travis -v 1.8.0 --no-rdoc --no-ri
$ travis version
1.8.0
  1. Go to the root of your repo, encrypt the token your JSPM_GITHUB_AUTH_TOKEN
travis encrypt 'JSPM_GITHUB_AUTH_TOKEN=[JSPM_GITHUB_AUTH_TOKEN]'

outputs your ENCRYPTED_STRING

  1. Include in your .travis.yml
env:
  global:
  - secure: [ENCRYPTED_STRING]

before_install:
- npm install -g jspm
- jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN
  1. Optional

nano ~/.jspm/config

remove the registries.github part so that the token will only be used by Travis (not by you).

@davinkevin
Copy link

But don't forget (and correct me if I'm wrong), the token will only be used by master and branch from repository, not by Pull Request... because it's sensitive data

@thomaslundstrom
Copy link

FWIW, this also works if using AppVeyor instead of Travis.

@trungie
Copy link

trungie commented May 24, 2016

If anyone is getting 404 errors, don't forget to check public_repo scope when you create your github key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment