From 9f5b9cdea833db2c9694975351f2228975aea852 Mon Sep 17 00:00:00 2001 From: Erno Emmanuel Ban Date: Tue, 10 Jan 2023 16:03:47 +0200 Subject: [PATCH 1/2] changed raw secrets to env variables --- lib/travis/yml/config.rb | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/travis/yml/config.rb b/lib/travis/yml/config.rb index e5e75b8eb..0f5dd6a44 100644 --- a/lib/travis/yml/config.rb +++ b/lib/travis/yml/config.rb @@ -4,16 +4,34 @@ module Travis module Yml class Config < Travis::Config + class << self + def auth_keys + ENV['TRAVIS_AUTH_KEYS'] || ['abc123'] + end + + def auth_internal + ENV['TRAVIS_AUTH_INTERNAL'] || 'token' + end + + def travis_token + ENV['TRAVIS_TOKEN'] || 'token' + end + + def vcs_token + ENV['TRAVIS_VCS_TOKEN'] || 'token' + end + end + define enterprise: false, - auth_keys: ['abc123'], - auth: { internal: 'token' }, + auth_keys: auth_keys, + auth: { internal: auth_internal }, oauth2: {}, github: { url: 'https://api.github.com', ssl: {} }, - travis: { url: 'https://api.travis-ci.com', app: 'yml', token: 'token', ssl: {} }, + travis: { url: 'https://api.travis-ci.com', app: 'yml', token: travis_token, ssl: {} }, metrics: { reporter: 'librato' }, imports: { max: 25 }, ssl: {}, - vcs: { url: 'https://vcs.travis-ci.com', token: 'token' }, + vcs: { url: 'https://vcs.travis-ci.com', token: vcs_token }, log_level: ENV.fetch("LOG_LEVEL", Logger::WARN) def metrics From c12dae66e996ca81dbd5c458537113d0098615d7 Mon Sep 17 00:00:00 2001 From: Erno Emmanuel Ban Date: Wed, 11 Jan 2023 18:51:59 +0200 Subject: [PATCH 2/2] corrected list handling --- lib/travis/yml/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/yml/config.rb b/lib/travis/yml/config.rb index 0f5dd6a44..0e6723522 100644 --- a/lib/travis/yml/config.rb +++ b/lib/travis/yml/config.rb @@ -6,7 +6,7 @@ module Yml class Config < Travis::Config class << self def auth_keys - ENV['TRAVIS_AUTH_KEYS'] || ['abc123'] + ENV['TRAVIS_AUTH_KEYS'].split(',') || ['abc123'] end def auth_internal