Travis doesn't decrypt secure environment variables

Hi there,

I’ve been experiencing an issue today with a Travis build which previously worked fine with a secure variable, however I’ve recently had to change the content of the variable, and it now no longer decrypts the variable content successfully.

The build in question is here:
https://travis-ci.org/github/epirus-io/epirus-cli/jobs/688882890

I’ve logged in to the Travis CLI (v1.9.1), and added the environment variable using the following command:

travis encrypt GITHUB_PERSONAL_ACCESS_TOKEN="<value>" --org --add

This runs successfully, and results in the following output:

However, travis does not seem to be decrypting the name of the variable, nor does it export it anywhere in the build console output when the build is triggered.

I should also mention that I’ve tried making the secure variable a list (by prepending - ), to no avail.

A likely explanation is that your encrypted value is wrong. Try explicitly specifying the repository name with the -r flag: travis encrypt -r epirus-io/epirus-cli …

Alternatively, you can define the secrets in the Settings page.

1 Like

Hey @BanzaiMan

Specifying the repository name with -r did indeed work. However I’ve always been running the encrypt command inside the project directory (root dir of the git repo), so I’m a little confused as to why this step was needed, as the docs imply that it’s only required if you’re running the command outside of the repo.

Thanks for the guidance!