Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Trouble with generarating public key for the repository #5

Open
TrueFinch opened this issue Jan 11, 2019 · 1 comment
Open

Trouble with generarating public key for the repository #5

TrueFinch opened this issue Jan 11, 2019 · 1 comment

Comments

@TrueFinch
Copy link

TrueFinch commented Jan 11, 2019

This command travis encrypt -r user/repo 'GITHUB_SECRET_TOKEN=<your token>'generated wrong keys for me. In console i've got something like that:

Setting environment variables from .travis.yml
$ export GITHUB_SECRET_TOKEN=[secure]
The previous command failed, possibly due to a malformed secure environment variable.
Please be sure to escape special characters such as ' ' and '$'.
For more information, see https://docs.travis-ci.com/user/encryption-keys.

This is my travis.yml:

sudo: true
dist: xenial
language: cpp

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
env:
  - secure: "key"

git:
  submodules: false
  
before_install:
  - sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
  - git submodule update --init --recursive
  
script:
  - mkdir build
  - cd build
  - cmake .. 
  - cmake --build .
  - "./tests/tests [implemented]"
after_success:
  - ls
  - echo $TRAVIS_COMMIT
  - echo $TRAVIS_BRANCH
  - cd ..
  - curl -o /tmp/travis-automerge https://raw.githubusercontent.com/kappatych/travis-automerge/master/travis-automerge
  - chmod a+x /tmp/travis-automerge
  - BRANCHES_TO_MERGE_REGEX='^f.*' BRANCH_TO_MERGE_INTO=develop GITHUB_REPO=kappatych/ci_test /tmp/travis-automerge

Also tried to set key through environment variables on the site, but it did not work too and throw such exception:
fatal: unable to access 'https://*generated key here*[email protected]/kappatych/ci_test/': Could not resolve host: *part of generated key here*

Maybe this is my fault. I do not understand why is this happening

@TrueFinch
Copy link
Author

Found solution. Using such command to encrypt token gives valid key:
travis encrypt -r KappaTych/ci_test GITHUB_SECRET_TOKEN="token"

But I still do not understand how to set this variable in the repository settings :(

This is how I put it in travis.yml:

env:
  - secure: "key"

Am I right that this way to store key is not very good? Cause everybody can just get on our repository travis site and get this key. Sounds not very good fo me. Please correct me, if I am wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant