Fix CI: Correctly copy Ent files excluding schema directory

Use find with proper path handling to copy all generated .go files
while excluding the schema directory and preserving subdirectory structure.
This commit is contained in:
2025-11-07 08:39:43 +01:00
parent 974821b78f
commit 12ea092a05

View File

@@ -50,9 +50,8 @@ jobs:
cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema
echo "Copying Ent code to internal/ent..." echo "Copying Ent code to internal/ent..."
mkdir -p ../internal/ent mkdir -p ../internal/ent
find . -name "*.go" -type f -exec cp --parents {} ../internal/ent/ \; find . -name "*.go" -type f ! -path "./schema/*" -exec sh -c 'mkdir -p ../internal/ent/$(dirname "{}") && cp "{}" ../internal/ent/"{}"' \;
rm -f ../internal/ent/generate.go rm -f ../internal/ent/generate.go
rm -rf ../internal/ent/schema
echo "Verifying internal/ent/ent.go exists..." echo "Verifying internal/ent/ent.go exists..."
ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!" ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!"
else else
@@ -122,9 +121,8 @@ jobs:
cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema
echo "Copying Ent code to internal/ent..." echo "Copying Ent code to internal/ent..."
mkdir -p ../internal/ent mkdir -p ../internal/ent
find . -name "*.go" -type f -exec cp --parents {} ../internal/ent/ \; find . -name "*.go" -type f ! -path "./schema/*" -exec sh -c 'mkdir -p ../internal/ent/$(dirname "{}") && cp "{}" ../internal/ent/"{}"' \;
rm -f ../internal/ent/generate.go rm -f ../internal/ent/generate.go
rm -rf ../internal/ent/schema
echo "Verifying internal/ent/ent.go exists..." echo "Verifying internal/ent/ent.go exists..."
ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!" ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!"
else else
@@ -179,9 +177,8 @@ jobs:
cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema
echo "Copying Ent code to internal/ent..." echo "Copying Ent code to internal/ent..."
mkdir -p ../internal/ent mkdir -p ../internal/ent
find . -name "*.go" -type f -exec cp --parents {} ../internal/ent/ \; find . -name "*.go" -type f ! -path "./schema/*" -exec sh -c 'mkdir -p ../internal/ent/$(dirname "{}") && cp "{}" ../internal/ent/"{}"' \;
rm -f ../internal/ent/generate.go rm -f ../internal/ent/generate.go
rm -rf ../internal/ent/schema
echo "Verifying internal/ent/ent.go exists..." echo "Verifying internal/ent/ent.go exists..."
ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!" ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!"
else else