Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 24 additions & 5 deletions .github/workflows/raw-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
run: |
set -euo pipefail
MANIFEST_FILE=".github/raw-mirror-paths.txt"
# Set up CR variable for proper quoting in expansions
CR=$'\r'

rm -rf .raw-mirror-staging
mkdir -p .raw-mirror-staging
Expand All @@ -67,9 +69,9 @@ jobs:

while IFS= read -r line || [ -n "$line" ]; do
path="${line%%#*}"
path="${path%$'\r'}"
path="${path#${path%%[![:space:]]*}}"
path="${path%${path##*[![:space:]]}}"
path="${path%"$CR"}"
path="${path#"${path%%[![:space:]]*}"}"
path="${path%"${path##*[![:space:]]}"}"

if [ -z "$path" ]; then
continue
Expand All @@ -84,10 +86,27 @@ jobs:
;;
esac

# Support multiple potential build locations: prefer public/, fall back to static/ (some builds place assets there).
source_file="public/$path"
Comment on lines +89 to 90
if [ ! -f "$source_file" ]; then
echo "Missing built artifact: $source_file"
exit 1
# try static/ (source assets present in repo)
if [ -f "static/$path" ]; then
source_file="static/$path"
else
Comment on lines +89 to +95
# try static/images/branding/<basename> for image-only fallbacks (restrict to images/ prefix)
if [[ "$path" == images/* ]]; then
base="$(basename "$path")"
if [ -f "static/images/branding/$base" ]; then
source_file="static/images/branding/$base"
else
echo "Missing built artifact: public/$path (also checked static/$path and static/images/branding/$base)"
exit 1
fi
else
echo "Missing built artifact: public/$path (also checked static/$path)"
exit 1
fi
fi
fi

mkdir -p ".raw-mirror-staging/$(dirname "$path")"
Expand Down
Loading