#30263·fastlane

[import_certificate] keychain_name is declared required but is not needed when keychain_path is given

Author: lacostejCreated Sep 21, 2026Updated Sep 25, 2026

import_certificate declares keychain_name as optional: false, so the documentation and fastlane action import_certificate present it as required. It is not required when keychain_path is given.

import_certificate.rb:7:

ruby
keychain_path = params[:keychain_path] || FastlaneCore::Helper.keychain_path(params[:keychain_name])

|| short-circuits, so with a keychain_path the value of keychain_name is never fetched, and the check behind optional: false never runs. Fetching is what enforces it, not building the configuration.

Measured:

keychain_path only  ->  resolves, keychain_name never read
keychain_name only  ->  resolves through Helper.keychain_path
neither             ->  FastlaneError: No value found for 'keychain_name'

So the declaration overstates the requirement. Someone reading the options believes they must pass a name; someone passing only a path finds it works. The error for passing neither also names the wrong thing, since either option would have satisfied it.

Worth checking the whole set before changing this one

delete_keychain models the same pair differently, and better:

ruby
FastlaneCore::ConfigItem.new(key: :name,          conflicting_options: [:keychain_path], optional: true)
FastlaneCore::ConfigItem.new(key: :keychain_path, conflicting_options: [:name],          optional: true)

Both optional, mutually exclusive, with an explicit error when neither is given. It also spells the key :name rather than :keychain_name, so the two actions disagree about the name as well as the contract.

Thirty-seven actions declare at least one optional: false item, and the params[:a] || params[:b] shape appears in several. Most of those fall back to a literal rather than to another declared-required option, which is harmless, but the set has not been audited. A fix here that is not applied consistently would leave the same trap in whichever others have it, so the audit is worth doing first and the result worth recording in the issue.