ci: replace Create iOS Certificates placeholder with the real workflow - #585
Conversation
The workflow was authored in #510 (merchant POS app), which won't merge soon. It's app-agnostic infra — bundle id is a workflow_dispatch input — so extract it to main along with the two things it needs to run: - scripts/create-certificates.sh: --no-pr mode (pre-creates the certs branch from master over SSH, no GitHub token) and automatic App Store Connect API-key auth when APPLE_KEY_* are set. - fastlane create_certs lane: match with API-key auth, no Apple ID / 2FA. The lane calls setup_ci() so match has a temporary keychain to import the .p12 into — release_testflight already does this; without it match fails on a macOS runner with "User interaction is not allowed". Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
Claude finished @ignaciosantise's task in 3m 27s —— View job Code Review
Found 3 issue(s)Issue 1: Expression injection via
|
There was a problem hiding this comment.
Pull request overview
This PR replaces the existing placeholder Create iOS Certificates workflow on main with the real, dispatchable workflow and the minimal supporting code needed to mint iOS signing certs/profiles via Fastlane Match (CI-first), plus updated docs.
Changes:
- Replace
.github/workflows/create-ios-certs.yamlplaceholder with a realworkflow_dispatchworkflow that loops match types and posts compare links in the job summary. - Extend
scripts/create-certificates.shto support--no-pr(SSH-only branch push) and auto-select App Store Connect API-key auth whenAPPLE_KEY_*env vars are present. - Add
fastlane ios create_certslane and update README guidance to prefer the CI path.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/create-ios-certs.yaml |
Real CI workflow to create certs/profiles on macOS runner, looping match types and emitting compare links. |
scripts/create-certificates.sh |
Adds --no-pr mode and API-key auth path; handles branch pre-creation and local PR creation/merge. |
fastlane/Fastfile |
Adds ios create_certs lane using setup_ci() + API-key auth for unattended Match runs. |
README.md |
Updates certificate creation docs to lead with CI workflow and document local fallback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Workflow: pass bundle-id / certs-repo / match-types through env instead of
interpolating ${{ inputs.* }} into the run: body, so an input can't break out
of the command; skip empty entries from a doubled comma.
- Workflow: reword the job summary. It read as a failure ("Action required"),
but not opening PRs is deliberate — there is no write token for the certs
repo, by design — so say so and frame the links as the expected next step.
- cleanup_branch: only delete the branch while it's still identical to master.
Once match has pushed, the branch is the sole record of a certificate Apple
has already issued; deleting it stranded that cert and removed the
"branch already exists" guard, so the retry could mint a duplicate against
Apple's distribution-cert cap.
- Two unreachable error handlers: under set -e a failing command substitution
aborts at the assignment, so `if [ -z "$MASTER_SHA" ]` and `if [ $? -ne 0 ]`
after `gh pr create` never ran. Worse, 2>&1 captured gh's error into PR_URL,
so a failed PR creation exited silently with no instructions. The PR path now
reports the error and says not to re-run, since the certs already exist.
- README: note that gh is only needed for local runs; CI uses --no-pr.
Co-Authored-By: Claude <noreply@anthropic.com>
|
Pushed b67fa03 addressing the review. Notes on what I took and what I didn't: Applied
Not applied
Also changed, from running it for real: the job summary was reworded. It led with " |
Drop comments that restate the code (`# Parse flags`, `# Local path`, the stale `# 4.` / `# 5/6.` step numbers left over from the old numbering) and condense the ones worth keeping. The load-bearing rationale stays: why the branch is cut from master first, why cleanup won't delete a branch match has pushed to, why the two `set -e` workarounds exist, and why inputs go through env. Co-Authored-By: Claude <noreply@anthropic.com>
#585 extracted the cert-creation workflow to main, so this branch no longer needs its own copies. Resolved create-ios-certs.yaml, create-certificates.sh, fastlane/Fastfile and README.md to main's versions — those carry the review fixes this branch predates, notably the setup_ci() call in create_certs without which match fails to import the .p12 on a macOS runner. release-merchant-pos.yaml resolves the other way: main has only the #522 placeholder stub, the real workflow lives here. Co-Authored-By: Claude <noreply@anthropic.com>
Extracted from #510 so the cert workflow can be dispatched from
main(that PR won't merge soon, and I need to mint certs now).maincurrently has a placeholdercreate-ios-certs.yaml(added in #522) that only exists to register the workflow name for "Use workflow from". This replaces it with the real thing.What's here
Only the three files the workflow needs to run, plus the README section:
.github/workflows/create-ios-certs.yaml— placeholder → real workflow.workflow_dispatchwithbundle-id/certs-repo/match-typesinputs; loops the types and writes a compare URL per type to the job summary.scripts/create-certificates.sh— adds--no-pr(pre-creates the certs branch frommasterover SSH, so no GitHub token is needed; a teammate opens/merges the PR inreown-com/mobile-match) and picks App Store Connect API-key auth automatically whenAPPLE_KEY_ID/APPLE_ISSUER_ID/APPLE_KEY_CONTENTare set, falling back to interactive Apple ID auth locally.fastlane/Fastfile— newcreate_certslane:match(readonly: false)with API-key auth, no Apple ID / 2FA, so it runs unattended.README.md— "Creating Certificates for a New App" now leads with the CI path; the script is documented as the local fallback.The merchant POS app itself,
release-merchant-pos.yaml, and the release runbook all stay out of this PR.One deliberate difference from #510
create_certscallssetup_ci()first.release_testflightalready does; without itmatchon a macOS runner tries to import the.p12into the login keychain and fails withSecKeychainItemImport: User interaction is not allowed.Notes for review
APPLE_KEY_ID,APPLE_ISSUER_ID,APPLE_KEY_CONTENT,MATCH_KEYCHAIN_PASSWORDandMATCH_SSH_KEYare already repo-level (used byrelease-ios-base.yaml), andmacos-latest-xlargeis already in use.matchdoes not create the identifier, and fastlaneproducecan't authenticate with the API key.masterbeforematchruns, on purpose — pointed at a non-existent branch,matchmakes an orphan branch with only the new files (unmergeable) and re-mints a duplicate certificate because it can't see the existing one.Verification
bash -non the script,ruby -con the Fastfile, andYAML.load_fileon the workflow all pass;bundle exec fastlane laneslistsios create_certs. Not dispatched yet — I'll run it manually once this is onmain.🤖 Generated with Claude Code