Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit e0d57bc

Browse files
authored
Fix YAML issues
1 parent abf3767 commit e0d57bc

1 file changed

Lines changed: 23 additions & 42 deletions

File tree

.github/workflows/build-unsigned-ipa.yml

Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -449,54 +449,35 @@ jobs:
449449
DEVNAME="ProStore iOS"
450450
SCREENSHOTS='["https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot1.png","https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot2.png","https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot3.png","https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot4.png","https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot5.png"]'
451451
452-
# Ensure base repo JSON exists (matches your example, with expansion for $ICON_URL)
452+
# Create base repo JSON safely (single command, YAML-friendly)
453453
if [ ! -f "$REPO_FILE" ]; then
454-
cat > "$REPO_FILE" <<EOF
455-
{
456-
"name": "Official ProStore Repo",
457-
"identifier": "com.prostoreios.prostore.repo",
458-
"sourceURL": "https://ProStore-iOS.github.io/apps.json",
459-
"iconURL": "$ICON_URL",
460-
"website": "https://ProStore-iOS.github.io",
461-
"subtitle": "The BEST alternative app store for iOS!",
462-
"apps": []
463-
}
464-
EOF
454+
jq -n --arg icon "$ICON_URL" '{
455+
name: "Official ProStore Repo",
456+
identifier: "com.prostoreios.prostore.repo",
457+
sourceURL: "https://ProStore-iOS.github.io/apps.json",
458+
iconURL: $icon,
459+
website: "https://ProStore-iOS.github.io",
460+
subtitle: "The BEST alternative app store for iOS!",
461+
apps: []
462+
}' > "$REPO_FILE"
465463
fi
466464
467465
TMP=$(mktemp)
468466
469467
# Build the JSON representation of the new version (on one line to avoid parser issues)
470-
NEW_VERSION=$(jq -c -n --arg version "$VERSION" --arg date "$VERSION_DATE_ISO" --arg desc "$CHANGELOG" --arg url "$DOWNLOAD_URL" --arg sha "$SHA256" --arg minos "$MIN_OS" --arg fulldate "$FULL_DATE" --argjson size "$IPA_SIZE" '{version: $version, date: $date, localizedDescription: $desc, downloadURL: $url, size: $size, sha256: $sha, minOSVersion: $minos, fullDate: $fulldate}')
471-
472-
# JQ query with indented content to avoid YAML parser confusion
473-
read -r -d '' JQ_QUERY <<'EOF'
474-
if ( .apps | map(.bundleIdentifier // .bundleID) | index($bundle) ) then
475-
.apps |= map(
476-
if ((.bundleIdentifier // .bundleID) == $bundle) then
477-
( { "name": $name,
478-
"bundleIdentifier": $bundle,
479-
"developerName": $dev,
480-
"localizedDescription": $appdesc,
481-
"iconURL": $icon,
482-
"screenshotURLs": $screenshots
483-
} + { "versions": ( [ $newVer ] + ( .versions // [] ) ) } )
484-
else . end
485-
)
486-
else
487-
.apps += [
488-
{
489-
"name": $name,
490-
"bundleIdentifier": $bundle,
491-
"developerName": $dev,
492-
"localizedDescription": $appdesc,
493-
"iconURL": $icon,
494-
"screenshotURLs": $screenshots,
495-
"versions": [ $newVer ]
496-
}
497-
]
498-
end
499-
EOF
468+
NEW_VERSION=$(jq -c -n \
469+
--arg version "$VERSION" \
470+
--arg date "$VERSION_DATE_ISO" \
471+
--arg desc "$CHANGELOG" \
472+
--arg url "$DOWNLOAD_URL" \
473+
--arg sha "$SHA256" \
474+
--arg minos "$MIN_OS" \
475+
--arg fulldate "$FULL_DATE" \
476+
--argjson size "$IPA_SIZE" \
477+
'{version: $version, date: $date, localizedDescription: $desc, downloadURL: $url, size: $size, sha256: $sha, minOSVersion: $minos, fullDate: $fulldate}')
478+
479+
# Single-line jq filter (YAML-friendly)
480+
JQ_QUERY='if ( .apps | map(.bundleIdentifier // .bundleID) | index($bundle) ) then .apps |= map( if ((.bundleIdentifier // .bundleID) == $bundle) then ( { "name": $name, "bundleIdentifier": $bundle, "developerName": $dev, "localizedDescription": $appdesc, "iconURL": $icon, "screenshotURLs": $screenshots } + { "versions": ( [ $newVer ] + ( .versions // [] ) ) } ) else . end ) else .apps += [ { "name": $name, "bundleIdentifier": $bundle, "developerName": $dev, "localizedDescription": $appdesc, "iconURL": $icon, "screenshotURLs": $screenshots, "versions": [ $newVer ] } ] end'
500481
501482
# Update or create the app entry (pass screenshots as argjson directly)
502483
jq --argjson newVer "$NEW_VERSION" \

0 commit comments

Comments
 (0)