How to set github token on Travis CI in a secure way?

Jeff Tian

I created an organization and a open source project under it, and uploaded the .travis file to do the building and deploying to github pages.

To deploy I need a github token, I found there is no "settings" page on the travis admin, so how I have to put the token in .travis file in plain text:

enter image description here

How to add it securely?

Jeff Tian

Find out the official document: https://docs.travis-ci.com/user/environment-variables#defining-encrypted-variables-in-travisyml

Basically speaking, it needs these steps:

gem install travis
travis login  # input github account and password
travis encrypt github_token=<token> --add env.matrix

and it auto update the .travis file, so you only need to git push then.

For why there is no settings options, I guess it because the repo is under organization.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Travis-ci needs root privilege when using go test, how to set it?

How to set up Travis CI with multiple languages

How to set the "api_key" value in Travis CI

travis-ci setup releases with --github-token

Deploying a Maven version to Github using Travis CI

How to allow Travis-CI access to a GitHub organisation with restricted applications access?

Is there a way to start android emulator in Travis CI build?

How to override Slack channels in Travis-CI notification when encrypting the token?

How to use Travis CI environment variables + .sh script for auto deployment to Github Pages?

How to set up Travis CI and postgresql using custom db credentials?

Travis CI deploy to S3 bucket not working with secure keys

How to trigger a fail in Travis CI?

Custom label for Travis CI badge on github repo

Correct way to obtain Travis CI build URL

Pipeline GitHub -> Travis CI -> Docker

How to make sure Travis-CI is correctly synced with GitHub repo?

How to secure CI/CD pipeline

How to set up Travis CI to use linked (local) packages?

How to secure a refresh token?

How to publish Travis CI artifacts to GitHub Release from several jobs

Getting the Travis CI build status of a GitHub commit

How to get Travis CI to build and test xcode projects hosted on Github?

Is there a way to use ruby in a node environment on Travis CI?

How to encode ç ö ü in a secure way?

Travis-CI stopped building Github project

Error authenticating Github using Travis CI

How is Travis-Ci's pypi deployment secure?

Set up CI with Travis for .NET Core

How to remove caches on Travis CI?