Conversation
Agent-Logs-Url: https://github.com/aoyn1xw/swift-devcontainer/sessions/37e631a8-eea8-42eb-8640-853477994488 Co-authored-by: aoyn1xw <200272391+aoyn1xw@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aoyn1xw/swift-devcontainer/sessions/37e631a8-eea8-42eb-8640-853477994488 Co-authored-by: aoyn1xw <200272391+aoyn1xw@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CI/CD pipeline failure on zsign help verification
Harden zsign CI verification by asserting help output instead of exit code
Apr 16, 2026
There was a problem hiding this comment.
Pull request overview
Adjusts CI tool verification to avoid false failures caused by zsign -h returning a non-zero exit code despite printing valid help output.
Changes:
- Updates the “Verify zsign help” workflow step to assert expected help text via
grep, rather than depending onzsign’s exit status.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The workflow fails at
Verify zsign helpbecausezsign -hprints valid help text but exits with code255, which GitHub Actions treats as failure. This change makes verification output-based so CI validates functionality without depending on zsign’s non-standard help exit status.Workflow change: zsign verification
.github/workflows/build-and-push.ymlto checkzsign -houtput for known help markers (Usage: zsignorcodesign alternative) rather than requiring a zero exit code fromzsignitself.Behavioral impact
Original prompt
The CI/CD pipeline fails at the "Verify zsign help" step because
zsign -hexits with code 255, even though it successfully displays the help menu.Currently, the verification step only runs:
Since the exit code is non-zero, GitHub Actions treats this as a failure and the workflow times out or fails.
Solution: Instead of just running
zsign -hand relying on exit codes, validate that zsign is working by checking for expected output in the help menu. This confirms the tool is installed and functional.The help output contains distinctive text like "Usage: zsign" or "codesign alternative" that we can grep for to validate the tool is working correctly.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Okay so my ci/di fails becaus after it calls zsign ti checks if it installs it dose not know what to do afterwards and timeouts can try to plan it out
Run docker run --rm swift-devcontainer:test-e382eb342051d3f0f01067b427f62ed5b09c9836 zsign -h
zsign (v1.0.4) is a codesign alternative for iOS12+ on macOS, Linux and Windows.
Visit https://github.com/zhlynn/zsign for more information.
Usage: zsign [-options] [-k privkey.pem] [-m dev.prov] [-o output.ipa] file|folder
options:
-k, --pkey Path to private key or p12 file. (PEM or DER format)
-m, --prov Path to mobile provisioning profile.
-c, --cert Path to certificate file. (PEM or DER format)
-a, --adhoc Perform ad-hoc signature only.
-d, --debug Generate debug output files. (.zsign_debug folder)
-f, --force Force sign without cache when signing folder.
-o, --output Path to output ipa file.
-p, --password Password for private key or p12 file.
-b, --bundle_id New bundle id to change.
-n, --bundle_name New bundle name to change.
-r, --bundle_version New bundle version to change.
-e, --entitlements New entitlements to change.
-z, --zip_level Compressed level when output the ipa file. (0-9)
-l, --dylib Path to inject dylib file. Use -l multiple time to inject multiple dylib files at once.
-D, --rm_dylib Name of dylib to remove. Use -D multiple times to remove multiple dylibs at once.
-w, --weak Inject dylib as LC_LOAD_WEAK_DYLIB.
-i, --install Install ipa file using ideviceinstaller command for test.
-t, --temp_folder Path to temporary folder for intermediate files.
-2, --sha256_only Serialize a single code directory that uses SHA256.
-C, --check Check certificate validity and OCSP revocation status.
-q, --quiet Quiet operation.
-x, --metadata Extract metadata and icon to the specified directory.
-R, --rm_provision Remove mobileprovision file after signing.
-S, --enable_docs Enable UISupportsDocumentBrowser and UIFileSharingEnabled.
-M, --min_version Set MinimumOSVersion in Info.plist.
-E, --rm_extensions Remove all app extensions (PlugIns/Extensions).
-W, --rm_watch Remove watch app from the bundle.
-U, --rm_uisd Remove UISupportedDevices from Info.plist.
-v, --version Shows version.
-h, --help Shows help (this message).
Error: Process completed with exit code 255.
Assistant: I can see the issue. The
zsigncommand completed successfully (it just printed the help message with exit code 255 because no actual signing parameters were provided), but your CI/CD pipeline doesn't have a follow-up action after verifying the installation. It's checking thatzsignis available but then timing out because there's no defined next step.Let me examine your repository to understand the current CI/CD configuration:
Assistant: Let me check the workflow file to understand the current CI/CD setup:
Assistant: Now I see the issue. Your CI/CD workflow is running verification steps, and line 53 runs
zsign -hto verify it's installed. The problem is thatzsign -hexits with exit code 255, which causes the step to fail because GitHub Actions treats any non-zero exit code as failure.The
zsign -hcommand actually works and displays help, but the tool itself returns a non-zero exit code. Here's the plan to fix this:Solution Options:
Option 1: Allow non-zero exit codes (Simplest)
Modify line 52-53 to ignore the exit code:
The
|| truemakes the step pass regardless of exit code.Option 2: Check if zsign binary exists (More robust)
Replace the help verification with a simpler existence check:
This will pass if
zsignis in the PATH and fail cleanly if it's not.Option 3: Use exit code checking (Most explicit)
My Recommendation:
Use Option 1 (
|| true) ...This pull request was created from Copilot chat.