Skip to content
Merged
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
16 changes: 15 additions & 1 deletion .github/scripts/update-checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# - Docker Compose files for offline usage support
# - File formatting (trailing newlines, whitespace)
# - Proper shebangs in command files
# - Command files are executable
#
# Usage (run from the add-on root directory):
# curl -fsSL https://ddev.com/s/addon-update-checker.sh | bash
Expand Down Expand Up @@ -197,6 +198,16 @@ check_shebang() {
done < <(find commands -type f -print0 2>/dev/null || true)
}

# Check that certain commands/**/* files are executable
check_command_executability() {
local file
while IFS= read -r -d '' file; do
if [[ ! -x "$file" ]]; then
actions+=("$file should be executable, run 'chmod +x \"$file\"'")
fi
done < <(find commands -type f -print0 2>/dev/null || true)
}

# Check .github/workflows/tests.yml for required conditions
check_tests_workflow() {
local tests_yml=".github/workflows/tests.yml"
Expand Down Expand Up @@ -278,7 +289,7 @@ check_addon_template_mentions() {
# Check LICENSE file for Apache License
check_license() {
local license_file="LICENSE"

if [[ -f "$license_file" ]]; then
if ! grep -q "Apache License" "$license_file"; then
actions+=("LICENSE should contain 'Apache License', see upstream file $UPSTREAM/$license_file")
Expand Down Expand Up @@ -368,6 +379,9 @@ main() {
# Check shebang in commands/**/* files
check_shebang

# Check commands/**/* files are executable
check_command_executability

# Check tests workflow
check_tests_workflow

Expand Down