Skip to content

Commit

Permalink
Update migrate-s3.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepstaylor committed Oct 9, 2024
1 parent 3240e0b commit be59346
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/migrate-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ jobs:
SRC_BUCKET="s3://${{ vars.MIGRATION_SRC_BUCKET }}"
DIRS=""
echo "$(aws s3api list-objects-v2 --bucket $SRC_BUCKET --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text)"
for prefix in $(aws s3api list-objects-v2 --bucket $SRC_BUCKET --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text); do
IFS=' '
prefixes=$(aws s3api list-objects-v2 --bucket $SRC_BUCKET --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text)
for prefix in $prefixes; do
echo "$(aws s3api list-objects-v2 --bucket $SRC_BUCKET --prefix "$prefix" --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text)"
DIR=$(aws s3api list-objects-v2 --bucket $SRC_BUCKET --prefix "$prefix" --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text)
#append to DIRS comma separated
DIRS+="${DIR},"
if [ -n "$DIR" ]; then
DIRS="${DIRS}${DIR},"
fi
done
DIRS=${DIRS%,}
Expand Down

0 comments on commit be59346

Please sign in to comment.