@@ -365,6 +365,42 @@ check_ddev_generated() {
365365 done
366366}
367367
368+ # Check that dependencies in install.yaml use org/repo format
369+ check_dependencies () {
370+ local install_yaml=" install.yaml"
371+
372+ local line entry in_section
373+ local list_item_re=' ^[[:space:]]*-[[:space:]]+(.*)'
374+
375+ in_section=false
376+ while IFS= read -r line; do
377+ if [[ " $line " == " dependencies:" ]]; then
378+ in_section=true
379+ continue
380+ fi
381+
382+ [[ " $in_section " != " true" ]] && continue
383+
384+ # A top-level YAML key (starts with a letter) ends the section
385+ [[ " $line " =~ ^[a-zA-Z] ]] && break
386+
387+ [[ " $line " =~ $list_item_re ]] || continue
388+ entry=" ${BASH_REMATCH[1]} "
389+
390+ [[ -z " $entry " ]] && continue
391+
392+ if [[ " $entry " != * /* ]]; then
393+ local example_repo
394+ if [[ " $entry " == ddev-* ]]; then
395+ example_repo=" ddev/$entry "
396+ else
397+ example_repo=" ddev/ddev-$entry "
398+ fi
399+ actions+=(" install.yaml dependency '$entry ' should use org/repo format (e.g. '$example_repo '), see upstream file $UPSTREAM /$install_yaml " )
400+ fi
401+ done < " $install_yaml "
402+ }
403+
368404# Check .gitattributes
369405check_gitattributes () {
370406 local gitattributes=" .gitattributes"
@@ -467,6 +503,9 @@ run_checks() {
467503 # Check #ddev-generated in files listed in install.yaml
468504 check_ddev_generated
469505
506+ # Check dependencies use org/repo format
507+ check_dependencies
508+
470509 # Check docker-compose.*.yaml for conditions
471510 check_docker_compose_yaml
472511
0 commit comments