Skip to content

Commit

Permalink
Fix bug in configure_apply action
Browse files Browse the repository at this point in the history
When a new encryption key is recently added and pushed to `~/.mobile-secrets` by one developer, other developers will likely not yet have their own `~/.mobile-secrets` repo pulled to that latest commit that includes the new encryption key.

This means that in those scenarios, after a new project is set up for `configure` and a new encryption key is added, any other developer who would be told to "please now run `bundle exec fastlane run configure_apply`" will have the command fail, because on their local machine their `~/.mobile-secrets` would not yet have the new encryption key, and the preflight test we did about this at the start of the action would error early.

The fix is easy: make sure we only check for the presence of the encryption key _after_ we have entered the `prepare_repository` block and thus pulled and checked out the correct commit of `~/.mobile-secrets` first.
  • Loading branch information
AliSoftware authored Nov 14, 2024
1 parent 8ed2bb1 commit 60948b4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ module Fastlane
module Actions
class ConfigureApplyAction < Action
def self.run(params = {})
# Preflight
UI.user_error!('Decryption key could not be found') if Fastlane::Helper::ConfigureHelper.encryption_key.nil?

# Checkout the right commit hash etc. before applying the configuration
prepare_repository do
UI.user_error!('Decryption key could not be found') if Fastlane::Helper::ConfigureHelper.encryption_key.nil?

# Copy/decrypt the files
files_to_copy.each do |file_reference|
apply_file(file_reference, params[:force])
Expand Down

0 comments on commit 60948b4

Please sign in to comment.