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
39 changes: 39 additions & 0 deletions .github/scripts/update-checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,42 @@ check_ddev_generated() {
done
}

# Check that dependencies in install.yaml use org/repo format
check_dependencies() {
local install_yaml="install.yaml"

local line entry in_section
local list_item_re='^[[:space:]]*-[[:space:]]+(.*)'

in_section=false
while IFS= read -r line; do
if [[ "$line" == "dependencies:" ]]; then
in_section=true
continue
fi

[[ "$in_section" != "true" ]] && continue

# A top-level YAML key (starts with a letter) ends the section
[[ "$line" =~ ^[a-zA-Z] ]] && break

[[ "$line" =~ $list_item_re ]] || continue
entry="${BASH_REMATCH[1]}"

[[ -z "$entry" ]] && continue

if [[ "$entry" != */* ]]; then
local example_repo
if [[ "$entry" == ddev-* ]]; then
example_repo="ddev/$entry"
else
example_repo="ddev/ddev-$entry"
fi
actions+=("install.yaml dependency '$entry' should use org/repo format (e.g. '$example_repo'), see upstream file $UPSTREAM/$install_yaml")
fi
done < "$install_yaml"
}

# Check .gitattributes
check_gitattributes() {
local gitattributes=".gitattributes"
Expand Down Expand Up @@ -467,6 +503,9 @@ run_checks() {
# Check #ddev-generated in files listed in install.yaml
check_ddev_generated

# Check dependencies use org/repo format
check_dependencies

# Check docker-compose.*.yaml for conditions
check_docker_compose_yaml

Expand Down
1 change: 1 addition & 0 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ global_files:
ddev_version_constraint: '>= v1.24.10'

# List of add-on names that this add-on depends on
# Dependencies must use org/repo format (e.g. ddev/ddev-redis), otherwise DDEV cannot resolve them
dependencies:
# - ddev/ddev-redis

Expand Down
Loading