Skip to content

Commit 95d84d7

Browse files
christian-byrneSubagent 5ampagent
authored andcommitted
fix: use merge-multiple for snapshot artifact download (#8432)
## Summary Fixes the snapshot merge failure introduced by PR #8377 (actions/download-artifact v4→v7 upgrade). ## Root Cause The v5+ release of `download-artifact` changed behavior: when a `pattern` matches only a **single artifact**, files are extracted directly to `path/` without the artifact name subdirectory. When only one shard had changes, the merge loop couldn't find the expected `snapshots-shard-*/` directories. ## Fix Use `merge-multiple: true` — the documented pattern for combining sharded artifacts. This merges all matched artifacts directly into the target path, eliminating directory structure assumptions. ## Testing This fix can be validated by re-running the workflow on [PR #8276](#8276) after merge. --- - Fixes snapshot update workflow regression from #8377 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8432-fix-use-merge-multiple-for-snapshot-artifact-download-2f76d73d3650810b97fdfe28cd3c7694) by [Unito](https://www.unito.io) Co-authored-by: Subagent 5 <subagent@example.com> Co-authored-by: Amp <amp@ampcode.com>
1 parent ca4ecc2 commit 95d84d7

1 file changed

Lines changed: 19 additions & 27 deletions

File tree

.github/workflows/pr-update-playwright-expectations.yaml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
with:
181181
pattern: snapshots-shard-*
182182
path: ./downloaded-snapshots
183-
merge-multiple: false
183+
merge-multiple: true
184184

185185
- name: List downloaded files
186186
run: |
@@ -206,13 +206,13 @@ jobs:
206206
echo "MERGING CHANGED SNAPSHOTS"
207207
echo "=========================================="
208208
209-
# Check if any artifacts were downloaded
209+
# Check if any artifacts were downloaded (merge-multiple puts files directly in path)
210210
if [ ! -d "./downloaded-snapshots" ]; then
211211
echo "No snapshot artifacts to merge"
212212
echo "=========================================="
213213
echo "MERGE COMPLETE"
214214
echo "=========================================="
215-
echo "Shards merged: 0"
215+
echo "Files merged: 0"
216216
exit 0
217217
fi
218218
@@ -222,37 +222,29 @@ jobs:
222222
exit 1
223223
fi
224224
225-
merged_count=0
225+
# Count files to merge
226+
file_count=$(find ./downloaded-snapshots -type f | wc -l)
226227
227-
# For each shard's changed files, copy them directly
228-
for shard_dir in ./downloaded-snapshots/snapshots-shard-*/; do
229-
if [ ! -d "$shard_dir" ]; then
230-
continue
231-
fi
232-
233-
shard_name=$(basename "$shard_dir")
234-
file_count=$(find "$shard_dir" -type f | wc -l)
235-
236-
if [ "$file_count" -eq 0 ]; then
237-
echo " $shard_name: no files"
238-
continue
239-
fi
240-
241-
echo "Processing $shard_name ($file_count file(s))..."
228+
if [ "$file_count" -eq 0 ]; then
229+
echo "No snapshot files found in downloaded artifacts"
230+
echo "=========================================="
231+
echo "MERGE COMPLETE"
232+
echo "=========================================="
233+
echo "Files merged: 0"
234+
exit 0
235+
fi
242236
243-
# Copy files directly, preserving directory structure
244-
# Since files are already in correct structure (no browser_tests/ prefix), just copy them all
245-
cp -v -r "$shard_dir"* browser_tests/ 2>&1 | sed 's/^/ /'
237+
echo "Merging $file_count snapshot file(s)..."
246238
247-
merged_count=$((merged_count + 1))
248-
echo " ✓ Merged"
249-
echo ""
250-
done
239+
# Copy all files directly, preserving directory structure
240+
# With merge-multiple: true, files are directly in ./downloaded-snapshots/ without shard subdirs
241+
cp -v -r ./downloaded-snapshots/* browser_tests/ 2>&1 | sed 's/^/ /'
251242
243+
echo ""
252244
echo "=========================================="
253245
echo "MERGE COMPLETE"
254246
echo "=========================================="
255-
echo "Shards merged: $merged_count"
247+
echo "Files merged: $file_count"
256248
257249
- name: Show changes
258250
run: |

0 commit comments

Comments
 (0)