mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-05 13:41:59 +00:00
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](https://github.com/Comfy-Org/ComfyUI_frontend/pull/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>
This commit is contained in:
@@ -180,7 +180,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
pattern: snapshots-shard-*
|
pattern: snapshots-shard-*
|
||||||
path: ./downloaded-snapshots
|
path: ./downloaded-snapshots
|
||||||
merge-multiple: false
|
merge-multiple: true
|
||||||
|
|
||||||
- name: List downloaded files
|
- name: List downloaded files
|
||||||
run: |
|
run: |
|
||||||
@@ -206,13 +206,13 @@ jobs:
|
|||||||
echo "MERGING CHANGED SNAPSHOTS"
|
echo "MERGING CHANGED SNAPSHOTS"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
|
|
||||||
# Check if any artifacts were downloaded
|
# Check if any artifacts were downloaded (merge-multiple puts files directly in path)
|
||||||
if [ ! -d "./downloaded-snapshots" ]; then
|
if [ ! -d "./downloaded-snapshots" ]; then
|
||||||
echo "No snapshot artifacts to merge"
|
echo "No snapshot artifacts to merge"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "MERGE COMPLETE"
|
echo "MERGE COMPLETE"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "Shards merged: 0"
|
echo "Files merged: 0"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -222,37 +222,29 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
merged_count=0
|
# Count files to merge
|
||||||
|
file_count=$(find ./downloaded-snapshots -type f | wc -l)
|
||||||
|
|
||||||
# For each shard's changed files, copy them directly
|
if [ "$file_count" -eq 0 ]; then
|
||||||
for shard_dir in ./downloaded-snapshots/snapshots-shard-*/; do
|
echo "No snapshot files found in downloaded artifacts"
|
||||||
if [ ! -d "$shard_dir" ]; then
|
echo "=========================================="
|
||||||
continue
|
echo "MERGE COMPLETE"
|
||||||
fi
|
echo "=========================================="
|
||||||
|
echo "Files merged: 0"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
shard_name=$(basename "$shard_dir")
|
echo "Merging $file_count snapshot file(s)..."
|
||||||
file_count=$(find "$shard_dir" -type f | wc -l)
|
|
||||||
|
|
||||||
if [ "$file_count" -eq 0 ]; then
|
# Copy all files directly, preserving directory structure
|
||||||
echo " $shard_name: no files"
|
# With merge-multiple: true, files are directly in ./downloaded-snapshots/ without shard subdirs
|
||||||
continue
|
cp -v -r ./downloaded-snapshots/* browser_tests/ 2>&1 | sed 's/^/ /'
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Processing $shard_name ($file_count file(s))..."
|
|
||||||
|
|
||||||
# Copy files directly, preserving directory structure
|
|
||||||
# Since files are already in correct structure (no browser_tests/ prefix), just copy them all
|
|
||||||
cp -v -r "$shard_dir"* browser_tests/ 2>&1 | sed 's/^/ /'
|
|
||||||
|
|
||||||
merged_count=$((merged_count + 1))
|
|
||||||
echo " ✓ Merged"
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
|
|
||||||
|
echo ""
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "MERGE COMPLETE"
|
echo "MERGE COMPLETE"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "Shards merged: $merged_count"
|
echo "Files merged: $file_count"
|
||||||
|
|
||||||
- name: Show changes
|
- name: Show changes
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user