Skip to content

Commit 08ebf95

Browse files
authored
Merge pull request #619 from DefangLabs/lio/check
add name check
2 parents d69cef6 + 6ae5698 commit 08ebf95

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

scripts/check-sample-files.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ for dir in ./samples/*/; do
2323
echo " - [ ] ${dir}compose.yaml is not valid according to \`defang compose config\`: $output"
2424
fi
2525
)
26+
27+
# Ensure the name: in Compose matches the sample/folder name
28+
sample_name=$(basename "$dir")
29+
compose_name=$(grep -E '^name:' "${dir}compose.yaml" | awk '{print $2}')
30+
if [[ "$sample_name" != "$compose_name" ]]; then
31+
echo " - [ ] fix name: in ${dir}compose.yaml to be '$sample_name' (currently '$compose_name')"
32+
fi
2633
fi
2734

2835
# Check that we NOT have a .github/workflows/deploy.yaml file; it's generated from templates/deploy.yaml

0 commit comments

Comments
 (0)