codemagic-ci-cd / cli-tools

Various utilities to managing Android and iOS app builds, code signing, and deployment.
https://codemagic.io/start/
GNU General Public License v3.0
243 stars 42 forks source link

Fix running `app-store-connect get-certificate` without certificate private key #337

Closed priitlatt closed 1 year ago

priitlatt commented 1 year ago

When running app-store-connect get-certificate <certificate-id> without --certificate-key argument then the action crashes with the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/codemagic/cli/cli_app.py", line 206, in invoke_cli
    CliApp._running_app._invoke_action(args)
  File "/usr/local/lib/python3.11/site-packages/codemagic/cli/cli_app.py", line 163, in _invoke_action
    return cli_action(**action_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/codemagic/cli/cli_app.py", line 458, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/codemagic/tools/app_store_connect.py", line 706, in get_certificate
    assert private_key is not None
           ^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Ceritficate key is not necessary unless the certificate is to be saved. Changes in this PR remove the assertion that is causing the action to fail.

Updated actions