Skip to content

Fail certificate setup when Match fails and no renewal will run - #573

Open
ps2 wants to merge 1 commit into
devfrom
fix/certs-setup-failure
Open

ps2 wants to merge 1 commit into
devfrom
fix/certs-setup-failure

Conversation

@ps2

@ps2 ps2 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Fixes the silent certificate failure reported in LoopKit/Loop#2661.

Problem

create_certs.yml runs fastlane certs || true, so that check_and_renew_certificates can nuke and recreate an expired Distribution certificate. When Match rejects the certificate stored in Match-Secrets but the team still has other valid Distribution certificates, the check writes new_certificate_needed=false. No renewal runs, the Create Certificates job succeeds, and Build & Archive fails later at signing with the same Match error, far from its cause.

Change

  • The certs step gets id: certs and records certs_failed=true/false in $GITHUB_OUTPUT. It still continues on errors without an exit-code annotation.
  • set_output fails the job with an ::error:: pointing at the Match error in the certs step when the certs lane failed, no new certificate is needed, and FORCE_NUKE_CERTS is not set.

The renewal paths are unchanged.

Testing

The YAML parses. I simulated the set_output script for 5 cases:

certs lane new certificate needed nuke result
failed no – fails with the new error
failed yes enabled passes, nuke job runs as before
failed yes disabled fails, as before
ok no – passes
failed no forced passes, nuke job runs

It has not been run on GitHub Actions against a live Apple account.

The certs step ignored the fastlane certs exit status so that the renewal
check could nuke and recreate an expired certificate. When the check finds
only other, valid Distribution certificates in the team, no renewal runs,
the job still succeeded, and the build later failed at signing with the
same Match error.

Record the certs result and fail the job in that case, pointing to Match's
error about the certificate stored in Match-Secrets.

Reported in LoopKit/Loop#2661.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant