Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encrypting a file on Travis for a GitHub repo that was renamed

I am attempting to encrypt a file for use on Travis-CI, as I have successfully done before. However, at some point the associated GitHub repository was renamed. I now suspect -- but cannot confirm -- that the renaming occurred after I last successfully added an encrypted file.

The affected file contains an OAuth2 token that needs to be refreshed every several months, which is my current need. Without this, my tests don't run.

When I follow the directions here, I can successfully login to Travis, see my repos, etc, but I cannot encrypt a file for this repo. I used this instructions successfully when I created the encrypted file the first time.

Here's what happens:

$ travis encrypt-file tests/testthat/googlesheets_token.rds 
repository not known to https://api.travis-ci.com/: jennybc/gspreadr

The repository in question is https://github.com/jennybc/googlesheets but was renamed several months ago from gspread to googlesheets. At the time, this appeared to go well. I cannot find any evidence of the old repo name in GitHub or in my Travis account, so I can't figure out how to get around this error. Where is Travis digging up this old info to choke on?

like image 944
jennybryan Avatar asked Jun 29 '15 04:06

jennybryan


People also ask

How do I encrypt a Travis file?

Here we can use the encrypt command: travis encrypt super_secret_password=ahduQu9ushou0Roh --add - note that if you set this up multiple times for multiple files, you will have to use different variable names so the passwords don't override each other. Encrypt the file locally.

Can you encrypt GitHub repo?

git-crypt enables transparent encryption and decryption of files in a git repository. Files which you choose to protect are encrypted when committed, and decrypted when checked out. git-crypt lets you freely share a repository containing a mix of public and private content.

Which of the following encryption scheme is used by Travis CI?

Encryption scheme # Travis CI uses asymmetric cryptography. For each registered repository, Travis CI generates an RSA keypair. Travis CI keeps the private key private, but makes the repository's public key available to those who have access to the repository.


1 Answers

I found the answer in this issue thread. You need to look in .git/config and update the travis slug.

[travis]
slug = jennybc/MAKE_SURE_THIS_REFLECTS_CURRENT_REPO_NAME

Apparently this is NOT automatically updated when you rename a GitHub repo.

like image 113
jennybryan Avatar answered Nov 15 '22 10:11

jennybryan