File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
lib/fastlane/plugin/wpmreleasetoolkit/models Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ def initialize(params = {})
10
10
end
11
11
12
12
def source_contents
13
- return File . read ( secrets_repository_file_path ) unless ( self . encrypt || ENV . key? ( 'CIRCLECI' ) )
13
+ # TODO: This works only on CircleCI. I chose this variable because it's the one checked by Fastlane::is_ci.
14
+ # Fastlane::is_ci doesn't work here, so reimplementing the code has been necessary.
15
+ # (This should be updated if we change CI or if fastlane is updated.)
16
+ return File . read ( secrets_repository_file_path ) unless ( self . encrypt || ENV . key? ( 'CIRCLECI' ) )
14
17
return nil unless File . file? ( encrypted_file_path )
15
18
encrypted = File . read ( encrypted_file_path )
16
19
Fastlane ::Helper ::EncryptionHelper . decrypt ( encrypted , encryption_key )
Original file line number Diff line number Diff line change 61
61
end
62
62
end
63
63
64
- describe '#source_contents_on_ci ' do
64
+ describe '#source_contents on ci ' do
65
65
it 'gets the contents from the secrets repo' do
66
66
set_circle_env ( true ) do
67
67
allow ( File ) . to receive ( :read ) . with ( subject . secrets_repository_file_path ) . and_return ( 'source contents' )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def set_circle_env(define_ci)
30
30
is_ci = ENV . key? ( 'CIRCLECI' )
31
31
orig_circle_ci = ENV [ 'CIRCLECI' ]
32
32
if ( define_ci )
33
- ENV [ 'CIRCLECI' ] = 'CircleCI'
33
+ ENV [ 'CIRCLECI' ] = "true"
34
34
else
35
35
ENV . delete 'CIRCLECI'
36
36
end
You can’t perform that action at this time.
0 commit comments