Skip to content
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4d97f30
Add Blacksmith iOS video recording mode
lawrencecchen Jun 20, 2026
23ee095
Clean up iOS video simulator runs
lawrencecchen Jun 20, 2026
90b3509
Add synced iOS and macOS demo recording
lawrencecchen Jun 21, 2026
435b4cc
Record real desktop and iOS sync video
lawrencecchen Jun 23, 2026
67e7023
Bound real sync video cloud phases
lawrencecchen Jun 23, 2026
e7180e2
Use portable timeouts for sync video
lawrencecchen Jun 23, 2026
7e25bf1
Launch sync video app outside reload
lawrencecchen Jun 23, 2026
25d0054
Quiet sync video CLI JSON output
lawrencecchen Jun 23, 2026
a9367fc
Use canonical workspace create for sync video
lawrencecchen Jun 23, 2026
0b8efea
Fix sync video JSON field parser
lawrencecchen Jun 23, 2026
af7537a
Use screencapture frames for sync video macOS recording
lawrencecchen Jun 23, 2026
efbcb1d
Record macOS sync video from terminal snapshots
lawrencecchen Jun 23, 2026
7a461ba
Launch real iOS sync video with attach env
lawrencecchen Jun 23, 2026
7eaf25d
Allow launch attach tickets to auth mobile shell
lawrencecchen Jun 23, 2026
93d1bb4
Harden real sync video iOS launch
lawrencecchen Jun 23, 2026
496d65d
Authenticate real sync recording with fixture user
lawrencecchen Jun 23, 2026
0ce1d88
Pass iOS launch env explicitly in sync recording
lawrencecchen Jun 23, 2026
5fdca2c
Read dogfood attach URL from iOS launch args
lawrencecchen Jun 23, 2026
afa5a68
Seed iOS attach URL through launch defaults
lawrencecchen Jun 23, 2026
3879cd8
Capture iOS attach diagnostics in sync recording
lawrencecchen Jun 23, 2026
c805cba
Use debug mobile auth token for sync recording
lawrencecchen Jun 23, 2026
0af62f1
Open iOS workspace in sync recording
lawrencecchen Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 235 additions & 1 deletion .github/workflows/reload-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ on:
options:
- macos
- ios
- ios-video
- sync-video
test_filter:
description: iOS UI test class or class/method used to drive ios-video
required: false
default: "cmuxUITests/cmuxUITests/testStackAuthEntryUsesStableIdentifiers"
type: string
device_family:
description: Simulator family used by ios-video
required: false
default: iphone
type: choice
options:
- iphone
- ipad
runner:
description: >-
macOS runner label to build on. Blacksmith (blacksmith-6vcpu-macos-26),
Expand Down Expand Up @@ -93,7 +108,7 @@ jobs:
run: ./scripts/install-zig-ci.sh

- name: Provision GhosttyKit (macOS)
if: ${{ inputs.platform == 'macos' }}
if: ${{ inputs.platform == 'macos' || inputs.platform == 'sync-video' }}
run: ./scripts/download-prebuilt-ghosttykit.sh || ./scripts/ensure-ghosttykit.sh

- name: Mark deps-ready
Expand Down Expand Up @@ -160,6 +175,224 @@ jobs:
mkdir -p artifact
( cd "$out" && ditto -c -k --keepParent "$(basename "$archive")" "$GITHUB_WORKSPACE/artifact/archive.zip" )

# --- real sync video: launch real macOS+iOS apps, attach, record both screens ---
- name: Grant TCC screen recording permission
if: ${{ inputs.platform == 'sync-video' }}
run: |
set -euo pipefail
FFMPEG_BIN="$(command -v ffmpeg || true)"
if [ -z "$FFMPEG_BIN" ]; then
brew install ffmpeg
FFMPEG_BIN="$(command -v ffmpeg)"
fi
SYS_TCC="/Library/Application Support/com.apple.TCC/TCC.db"
if [ -f "$SYS_TCC" ]; then
for client in "$FFMPEG_BIN" /opt/homebrew/bin/ffmpeg /usr/local/bin/ffmpeg /usr/sbin/screencapture; do
sudo sqlite3 "$SYS_TCC" \
"INSERT OR REPLACE INTO access (service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES ('kTCCServiceScreenCapture', '$client', 1, 2, 4, 1, NULL, NULL, 0, 'UNUSED', NULL, 0, $(date +%s));" 2>&1 || true
done
fi
USER_TCC="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
if [ -f "$USER_TCC" ]; then
for client in "$FFMPEG_BIN" /opt/homebrew/bin/ffmpeg /usr/local/bin/ffmpeg; do
sqlite3 "$USER_TCC" \
"INSERT OR REPLACE INTO access (service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES ('kTCCServiceScreenCapture', '$client', 1, 2, 4, 1, NULL, NULL, 0, 'UNUSED', NULL, 0, $(date +%s));" 2>&1 || true
done
fi
APPROVALS_PLIST="$HOME/Library/Group Containers/group.com.apple.replayd/ScreenCaptureApprovals.plist"
if [ -d "$(dirname "$APPROVALS_PLIST")" ]; then
defaults write "$APPROVALS_PLIST" "$FFMPEG_BIN" -date "3000-01-01T00:00:00Z" 2>&1 || true
fi

- name: Record real macOS and iOS sync video
if: ${{ inputs.platform == 'sync-video' }}
env:
BUILD_TAG: ${{ inputs.tag }}
DEVICE_FAMILY: ${{ inputs.device_family }}
ARTIFACT_DIR: ${{ github.workspace }}/artifact
SYNC_MARKER: real-cmux-left-right-cloud-demo
run: scripts/ci/record-real-sync-video.sh

# --- iOS video: run a real simulator UI test while recording the screen ---
- name: Record iOS simulator video
if: ${{ inputs.platform == 'ios-video' }}
env:
BUILD_TAG: ${{ inputs.tag }}
DEVICE_FAMILY: ${{ inputs.device_family }}
TEST_FILTER: ${{ inputs.test_filter }}
PLATFORM: ${{ inputs.platform }}
run: |
set -euo pipefail

ios_ready() { xcrun simctl runtime list 2>/dev/null | grep -qiE "iOS [0-9].*\(Ready\)"; }
if ! ios_ready; then
echo "iOS platform not registered; installing via downloadPlatform iOS"
xcodebuild -downloadPlatform iOS 2>&1 | tr '\r' '\n' | grep -ivE 'Preparing to download|registering download' | tail -8 || true
ios_ready || { echo "iOS platform still not registered; simulator video would fail" >&2; exit 1; }
fi

./scripts/ensure-ghosttykit.sh

SIMULATOR_ENV="${RUNNER_TEMP:-$PWD/.tmp}/simulator-${DEVICE_FAMILY}.env"
mkdir -p "$(dirname "$SIMULATOR_ENV")"
python3 - <<'PY' > "$SIMULATOR_ENV"
import json
import os
import shlex
import subprocess
import sys

family = os.environ["DEVICE_FAMILY"]
data = json.loads(subprocess.check_output(["xcrun", "simctl", "list", "devices", "available", "-j"]))
devices = [
device
for runtimes in data.get("devices", {}).values()
for device in runtimes
if device.get("isAvailable", True)
]
prefix = "iPad" if family == "ipad" else "iPhone"
preferred = ["iPad Pro 13-inch (M4)", "iPad Air 13-inch (M3)"] if family == "ipad" else ["iPhone 17", "iPhone 16"]
selected = next((d for name in preferred for d in devices if d.get("name") == name), None)
selected = selected or next((d for d in devices if d.get("name", "").startswith(prefix)), None)
created = False
if selected is None:
runtimes_data = json.loads(subprocess.check_output(["xcrun", "simctl", "list", "runtimes", "available", "-j"]))
runtimes = [
runtime
for runtime in runtimes_data.get("runtimes", [])
if runtime.get("isAvailable", True)
and (
runtime.get("platform") == "iOS"
or runtime.get("identifier", "").startswith("com.apple.CoreSimulator.SimRuntime.iOS")
)
]
if not runtimes:
raise SystemExit(f"No available iOS simulator runtime for {family}")

def version_key(runtime):
return tuple(int(part) for part in runtime.get("version", "0").split(".") if part.isdigit())

runtime = sorted(runtimes, key=version_key, reverse=True)[0]
device_types_data = json.loads(subprocess.check_output(["xcrun", "simctl", "list", "devicetypes", "-j"]))
device_types = [
device_type
for device_type in device_types_data.get("devicetypes", [])
if device_type.get("name", "").startswith(prefix)
]
device_type = next((d for name in preferred for d in device_types if d.get("name") == name), None)
device_type = device_type or next(iter(device_types), None)
if device_type is None:
raise SystemExit(f"No available {prefix} simulator device type")
udid = subprocess.check_output([
"xcrun",
"simctl",
"create",
f"cmux Video {device_type['name']}",
device_type["identifier"],
runtime["identifier"],
], text=True).strip()
selected = {"udid": udid, "name": f"cmux Video {device_type['name']}"}
created = True
print(
f"Created {selected['name']} ({udid}) with {runtime['identifier']}",
file=sys.stderr,
)
print(f"SIMULATOR_ID={shlex.quote(selected['udid'])}")
print(f"SIMULATOR_NAME={shlex.quote(selected['name'])}")
print(f"SIMULATOR_CREATED={'1' if created else '0'}")
PY
# shellcheck disable=SC1090
. "$SIMULATOR_ENV"

IOS_DERIVED_DATA="${RUNNER_TEMP:-$PWD/.tmp}/cmux-ios-video"
RESULT_BUNDLE="$GITHUB_WORKSPACE/artifact/cmux-ios-video.xcresult"
VIDEO_PATH="$GITHUB_WORKSPACE/artifact/cmux-ios-${BUILD_TAG}.mp4"
FINAL_VIDEO_PATH="$VIDEO_PATH"
SCREENSHOT_PATH="$GITHUB_WORKSPACE/artifact/cmux-ios-${BUILD_TAG}.png"
Comment on lines +309 to +311

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 BUILD_TAG used raw in file paths without slug sanitization

The ios build step (line 141) sanitizes inputs.tag into a filesystem-safe slug before using it in paths (tr -c 'a-z0-9-' '-'). The ios-video step uses BUILD_TAG directly in VIDEO_PATH and SCREENSHOT_PATH. If the tag contains / (e.g. feature/my-branch), these paths will reference a non-existent subdirectory and xcrun simctl io recordVideo will fail, then the final [ -s "$VIDEO_PATH" ] guard will report "video not produced" without explaining the real cause. The metadata "video" key will also receive only the basename of the broken path.

Comment on lines +309 to +311

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Sanitize BUILD_TAG before using it in artifact filenames.

VIDEO_PATH/SCREENSHOT_PATH use raw BUILD_TAG; tags containing /, spaces, or shell-special chars can create invalid/nested paths and fail artifact creation. Reuse the slugging pattern already used in the iOS archive step.

Suggested patch
-          VIDEO_PATH="$GITHUB_WORKSPACE/artifact/cmux-ios-${BUILD_TAG}.mp4"
-          SCREENSHOT_PATH="$GITHUB_WORKSPACE/artifact/cmux-ios-${BUILD_TAG}.png"
+          SAFE_TAG="$(printf '%s' "$BUILD_TAG" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9-' '-' | sed 's/-\{2,\}/-/g; s/^-//; s/-$//')"
+          VIDEO_PATH="$GITHUB_WORKSPACE/artifact/cmux-ios-${SAFE_TAG}.mp4"
+          SCREENSHOT_PATH="$GITHUB_WORKSPACE/artifact/cmux-ios-${SAFE_TAG}.png"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/reload-build.yml around lines 266 - 267, The VIDEO_PATH
and SCREENSHOT_PATH variables are using the raw BUILD_TAG value which can
contain invalid path characters like forward slashes, spaces, or shell special
characters that will cause artifact creation to fail. Sanitize the BUILD_TAG
variable by applying the same slugging/sanitization pattern that is already
being used elsewhere in the iOS archive step of the workflow, and use the
sanitized version when constructing both VIDEO_PATH and SCREENSHOT_PATH.

RECORD_LOG="$GITHUB_WORKSPACE/artifact/record-video.log"
TEST_LOG="$GITHUB_WORKSPACE/artifact/xcodebuild-test.log"
mkdir -p artifact "$IOS_DERIVED_DATA"
rm -rf "$RESULT_BUNDLE" "$VIDEO_PATH" "$SCREENSHOT_PATH"

xcrun simctl shutdown "$SIMULATOR_ID" >/dev/null 2>&1 || true
xcrun simctl erase "$SIMULATOR_ID"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erase wipes shared simulators

Medium Severity

The ios-video step picks an existing available simulator when a preferred device already exists, then runs xcrun simctl erase on that UDID. On persistent self-hosted runners, that wipes a shared simulator other jobs rely on, not only a dedicated cmux Video instance.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4d97f30. Configure here.

xcrun simctl boot "$SIMULATOR_ID" >/dev/null 2>&1 || true
xcrun simctl bootstatus "$SIMULATOR_ID" -b

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simulator boot lacks timeout

Medium Severity

The ios-video step runs xcrun simctl bootstatus … -b with no timeout, while sync-video wraps the same wait in timeout 120s. A stuck simulator boot can hold the job until the 60-minute workflow limit instead of failing fast with logs.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 67e7023. Configure here.

xcrun simctl ui "$SIMULATOR_ID" appearance dark || true

XCODEBUILD_BASE=(
-workspace ios/cmux.xcworkspace
-scheme cmux-ios
-destination "platform=iOS Simulator,id=$SIMULATOR_ID"
-derivedDataPath "$IOS_DERIVED_DATA"
)
if [ -n "${TEST_FILTER:-}" ]; then
ONLY_TESTING=(-only-testing:"$TEST_FILTER")
else
ONLY_TESTING=(-only-testing:cmuxUITests/cmuxUITests/testStackAuthEntryUsesStableIdentifiers)
fi
Comment on lines +329 to +333

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unreachable else branch in ONLY_TESTING

TEST_FILTER is always defined in the step's env: block from inputs.test_filter, which has a non-empty default value. The else branch (and the duplicate fallback in metadata.json) are therefore dead code. Removing the redundant branch makes the intent clearer and avoids the confusion of two apparently authoritative default values.

Suggested change
if [ -n "${TEST_FILTER:-}" ]; then
ONLY_TESTING=(-only-testing:"$TEST_FILTER")
else
ONLY_TESTING=(-only-testing:cmuxUITests/cmuxUITests/testStackAuthEntryUsesStableIdentifiers)
fi
ONLY_TESTING=(-only-testing:"$TEST_FILTER")

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

xcodebuild "${XCODEBUILD_BASE[@]}" "${ONLY_TESTING[@]}" build-for-testing

recorder_pid=""
cleanup_video_run() {
if [ -n "$recorder_pid" ] && kill -0 "$recorder_pid" >/dev/null 2>&1; then
kill -INT "$recorder_pid" >/dev/null 2>&1 || true
wait "$recorder_pid" >/dev/null 2>&1 || true
fi
xcrun simctl shutdown "$SIMULATOR_ID" >/dev/null 2>&1 || true
if [ "${SIMULATOR_CREATED:-0}" = "1" ]; then
xcrun simctl delete "$SIMULATOR_ID" >/dev/null 2>&1 || true
fi
}
trap cleanup_video_run EXIT

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXIT trap registered too late

Medium Severity

The ios-video step boots and erases a simulator, then runs build-for-testing, but the EXIT trap that shuts down (and deletes created) simulators is not installed until after that build. Any failure from boot through build-for-testing exits with set -e without running cleanup, leaving a simulator running on the runner.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 23ee095. Configure here.


xcrun simctl io "$SIMULATOR_ID" recordVideo --codec=h264 --force "$VIDEO_PATH" 2> "$RECORD_LOG" &
recorder_pid="$!"
for _ in $(seq 1 80); do
grep -q "Recording started" "$RECORD_LOG" 2>/dev/null && break
sleep 0.25
done
grep -q "Recording started" "$RECORD_LOG" 2>/dev/null || {
echo "simctl recordVideo did not report startup" >&2
cat "$RECORD_LOG" >&2 || true
exit 1
}

test_rc=0
set +e
xcodebuild "${XCODEBUILD_BASE[@]}" "${ONLY_TESTING[@]}" \
-resultBundlePath "$RESULT_BUNDLE" \
test-without-building 2>&1 | tee "$TEST_LOG"
test_rc="${PIPESTATUS[0]}"
set -e
if ! grep -Eq 'Executed [1-9][0-9]* tests?, with 0 failures' "$TEST_LOG"; then
echo "ios-video did not execute any selected UI tests" >&2
test_rc=65

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed UI tests misreported

Medium Severity

The post-test grep treats any log line that is not Executed … with 0 failures as “no UI tests ran,” so a failing test overwrites xcodebuild’s exit code with 65 and prints the wrong stderr message. metadata.json’s testExitCode can misreport real UI failures.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit af7537a. Configure here.

fi

xcrun simctl io "$SIMULATOR_ID" screenshot --type=png "$SCREENSHOT_PATH" || true
cleanup_video_run
trap - EXIT

[ -s "$VIDEO_PATH" ] || { echo "video not produced: $VIDEO_PATH" >&2; exit 1; }
cat > "$GITHUB_WORKSPACE/artifact/metadata.json" <<JSON
{
"tag": "$BUILD_TAG",
"platform": "$PLATFORM",
"runner": "${{ inputs.runner }}",
"sourceRef": "${{ inputs.ref }}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metadata omits resolved source ref

Low Severity

metadata.json sets sourceRef from ${{ inputs.ref }} only. When the dispatch leaves ref empty, checkout still uses inputs.ref || github.ref, but metadata records an empty sourceRef instead of the ref that was actually built.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4d97f30. Configure here.

"deviceFamily": "$DEVICE_FAMILY",
"simulatorId": "$SIMULATOR_ID",
"simulatorName": "$SIMULATOR_NAME",
"testFilter": "${TEST_FILTER:-cmuxUITests/cmuxUITests/testStackAuthEntryUsesStableIdentifiers}",
"video": "$(basename "$FINAL_VIDEO_PATH")",
"testExitCode": $test_rc
}
Comment on lines +379 to +391

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Harden metadata.json generation against template/script injection and malformed JSON.

Dynamic fields are injected directly into an unquoted heredoc (${{ ... }} and shell vars). This can break JSON and may allow template/script injection if dispatch inputs contain control characters/newlines. Build the JSON with jq -n (or Python) and pass all values via env/--arg instead of inline expansion.

Suggested patch
       - name: Record iOS simulator video
         if: ${{ inputs.platform == 'ios-video' }}
         env:
           BUILD_TAG: ${{ inputs.tag }}
           DEVICE_FAMILY: ${{ inputs.device_family }}
           TEST_FILTER: ${{ inputs.test_filter }}
+          INPUT_RUNNER: ${{ inputs.runner }}
+          INPUT_REF: ${{ inputs.ref }}
         run: |
@@
-          cat > "$GITHUB_WORKSPACE/artifact/metadata.json" <<JSON
-          {
-            "tag": "$BUILD_TAG",
-            "platform": "ios-video",
-            "runner": "${{ inputs.runner }}",
-            "sourceRef": "${{ inputs.ref }}",
-            "deviceFamily": "$DEVICE_FAMILY",
-            "simulatorId": "$SIMULATOR_ID",
-            "simulatorName": "$SIMULATOR_NAME",
-            "testFilter": "${TEST_FILTER:-cmuxUITests/cmuxUITests/testStackAuthEntryUsesStableIdentifiers}",
-            "video": "$(basename "$VIDEO_PATH")",
-            "testExitCode": $test_rc
-          }
-          JSON
+          jq -n \
+            --arg tag "$BUILD_TAG" \
+            --arg platform "ios-video" \
+            --arg runner "$INPUT_RUNNER" \
+            --arg sourceRef "$INPUT_REF" \
+            --arg deviceFamily "$DEVICE_FAMILY" \
+            --arg simulatorId "$SIMULATOR_ID" \
+            --arg simulatorName "$SIMULATOR_NAME" \
+            --arg testFilter "${TEST_FILTER:-cmuxUITests/cmuxUITests/testStackAuthEntryUsesStableIdentifiers}" \
+            --arg video "$(basename "$VIDEO_PATH")" \
+            --argjson testExitCode "$test_rc" \
+            '{tag:$tag,platform:$platform,runner:$runner,sourceRef:$sourceRef,deviceFamily:$deviceFamily,simulatorId:$simulatorId,simulatorName:$simulatorName,testFilter:$testFilter,video:$video,testExitCode:$testExitCode}' \
+            > "$GITHUB_WORKSPACE/artifact/metadata.json"
🧰 Tools
🪛 zizmor (1.25.2)

[error] 335-335: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[error] 336-336: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/reload-build.yml around lines 331 - 343, The metadata.json
generation in the heredoc uses direct variable expansion which can break JSON
validity and enable injection attacks if inputs contain special characters or
newlines. Replace the current heredoc approach with jq -n to safely construct
the JSON object, passing all dynamic values (BUILD_TAG, DEVICE_FAMILY,
SIMULATOR_ID, SIMULATOR_NAME, TEST_FILTER, the basename of VIDEO_PATH, and
test_rc) either as environment variables or using jq --arg flags to ensure
proper escaping and prevent injection vulnerabilities while maintaining JSON
integrity.

Source: Linters/SAST tools

JSON
Comment on lines +379 to +392

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Shell variables interpolated into JSON without encoding

$SIMULATOR_NAME, $TEST_FILTER, and $BUILD_TAG are expanded directly into the JSON heredoc. If any value contains " or \ (e.g. a test filter path hand-edited by the dispatcher), the output file will be malformed and the downstream HQ parser may fail silently. The timings.json heredoc above has the same pattern with ${{ inputs.tag }} and ${{ inputs.ref }} (also unescaped), so the risk is already present there, but metadata.json adds more free-form shell variables. Generating the JSON with python3 -c "import json, os, sys; ..." or a jq -n call would guarantee well-formed output regardless of input characters.


exit "$test_rc"
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

- name: Write timings.json
if: ${{ always() }}
run: |
Expand Down Expand Up @@ -190,6 +423,7 @@ jobs:
} >> "$GITHUB_STEP_SUMMARY"

- name: Upload artifact
if: ${{ always() }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed builds upload partial artifacts

Low Severity

Adding if: ${{ always() }} to the upload step makes failed macos or ios runs publish an artifact directory that often contains only timings.json, not app.zip or archive.zip, which can look like a successful dev build to download logic that only checks for an artifact.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4d97f30. Configure here.

uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: reload-${{ inputs.tag }}-${{ inputs.platform }}
Expand Down
Loading
Loading