Skip to content

ci: use exit code instead of output text to detect pod trunk push success#51

Merged
andredestro merged 1 commit intomainfrom
ci/cocoapods-publish-exit-code-check
Apr 28, 2026
Merged

ci: use exit code instead of output text to detect pod trunk push success#51
andredestro merged 1 commit intomainfrom
ci/cocoapods-publish-exit-code-check

Conversation

@andredestro
Copy link
Copy Markdown
Contributor

Problem

The publish-ios.sh script was incorrectly reporting a publish failure even when pod trunk push succeeded. This happened because the success check relied on grepping for the word "passed" in the command output — a string that no longer appears in the current CocoaPods trunk response.

As a result, the CI job exited with code 1 and printed an error, despite the pod being successfully published to CocoaPods.

Example of this happening: https://github.com/ionic-team/capacitor-camera/actions/runs/25047098127/job/73365335595

Root Cause

CocoaPods used to include "passed" in its success output. The current output says "successfully published" instead, causing the grep to fail.

Before — fragile: depends on CocoaPods output format:

pod trunk push ... > $LOG_OUTPUT 2>&1
if grep -q "passed" $LOG_OUTPUT; then

Fix

Replace the text-based check with a direct exit code check, which is reliable regardless of CocoaPods output format changes.

After — reliable: checks the actual exit code:

if pod trunk push ... > $LOG_OUTPUT 2>&1; then

@andredestro andredestro merged commit 158cf3a into main Apr 28, 2026
8 checks passed
@andredestro andredestro deleted the ci/cocoapods-publish-exit-code-check branch April 28, 2026 14:47
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.

2 participants