4

I have forked a Github repository and would like to use travis-ci, as the original repository does, to run tests when I commit. However, the AWS keys, which are encrypted, are not decrypted and keep the tests from succeeding. Since my workplace owns the original repository, I have access to whatever is needed, but am unsure what information to retrieve, where to find it, or what to do with it.

For clarity, here is the pertinent part of the .travis.yml:

env:
  global:
  - NODE_ENV: test
  - [...]
  - secure: M3YSEJnWYd[...]
  - secure: kvvLABsWTq[...]

All of the environment variables are imported except the secure ones (which is to be expected, of course).

Community
  • 1
  • 1
ZAD-Man
  • 1,328
  • 23
  • 42
  • Did you ever find a solution? I have the same issue with regards to an encrypted file: http://stackoverflow.com/q/33558136/199166 – cbare Nov 06 '15 at 18:16
  • 1
    Sadly, no. :( I would love to do it this way, but I've had to just merge to the main repository. I hope to eventually find a solution, though, because it would certainly be much more convenient. – ZAD-Man Nov 06 '15 at 19:24
  • 2
    when you say it's failing, do you mean tests for PR or push? I'm spending hours working on this and so far, I've discovered that secure environment variables aren't made available to PRs from forks, due to security issue (https://docs.travis-ci.com/user/pull-requests/). I'm thinking of disabling tests on PR from forks, and just do manual testing for those... – nekonari Jan 23 '16 at 21:46
  • Hmm, let's see...I don't remember 100%, but I believe I was wanting Travis to run tests every time I pushed to my repository, before making a pull request. That's what makes sense to me now, at least. – ZAD-Man Jan 25 '16 at 16:33
  • Perhaps this workaround can be applied: https://stackoverflow.com/questions/39460636/travis-ci-decryption-of-encrypted-files/51329987#51329987 – Entreco Jul 13 '18 at 17:19
  • @Entreco Hm, I'd definitely say it's worth a try for future readers. I unfortunately no longer have access to the environment in question, nor one that fits the requirements, otherwise I'd try it myself. – ZAD-Man Jul 13 '18 at 20:00

1 Answers1

2

Travis documents that for security reasons secret variables are not available to forks (https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml). It should be possible though to set new secrets in travis.yml or fork‘s repo settings.

andig
  • 13,378
  • 13
  • 61
  • 98