Skip to content

Commit 3fbc8e5

Browse files
AndyMik90claude
andauthored
fix(ci): use two-step yq approach for manifest merging (#1408)
The 'add' function doesn't exist in yq v4, causing parse errors. Use a two-step approach that was tested locally: 1. Collect all files with '[.files] | flatten' 2. Load merged files into first manifest with 'load()' Tested locally with yq v4.50.1 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4a32847 commit 3fbc8e5

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎.github/actions/merge-macos-manifests/action.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ runs:
8080
echo "Installed yq version:"
8181
yq --version
8282
83-
# Merge the files arrays from both manifests using eval-all
84-
# Use single line to avoid shell/YAML parsing issues
85-
yq eval-all 'select(fileIndex == 0) * {"files": ([.[].files] | add)}' "$intel_manifest" "$arm64_manifest" > "${{ inputs.output-path }}/latest-mac.yml"
83+
# Merge the files arrays from both manifests using two-step approach
84+
# Step 1: Collect all files from both manifests into a temp file
85+
yq eval-all '[.files] | flatten' "$intel_manifest" "$arm64_manifest" > /tmp/merged-files.yml
86+
87+
# Step 2: Replace files array in first manifest with merged files
88+
yq eval '.files = load("/tmp/merged-files.yml")' "$intel_manifest" > "${{ inputs.output-path }}/latest-mac.yml"
8689
8790
echo "Merged manifest contents:"
8891
cat "${{ inputs.output-path }}/latest-mac.yml"

0 commit comments

Comments
 (0)