From f224582a8de6ccd449de377c9172212546f4e74c Mon Sep 17 00:00:00 2001 From: codebymikey <9484406+codebymikey@users.noreply.github.com> Date: Fri, 27 Mar 2026 14:57:08 +0000 Subject: [PATCH 1/4] Check that command files are executable by default --- .github/scripts/update-checker.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/scripts/update-checker.sh b/.github/scripts/update-checker.sh index 8b285bf..9c4a016 100755 --- a/.github/scripts/update-checker.sh +++ b/.github/scripts/update-checker.sh @@ -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 @@ -197,6 +198,15 @@ check_shebang() { done < <(find commands -type f -print0 2>/dev/null || true) } +# Check that certain commands/**/* files are executable +# Files starting with . or _ are exempt as they might be include files +check_command_executability() { + local file + while IFS= read -r -d '' file; do + actions+=("$file should be executable") + done < <(find commands -type f \! -executable \! -name '.*' \! -name '_*' -print0 2>/dev/null || true) +} + # Check .github/workflows/tests.yml for required conditions check_tests_workflow() { local tests_yml=".github/workflows/tests.yml" @@ -278,7 +288,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") @@ -368,6 +378,9 @@ main() { # Check shebang in commands/**/* files check_shebang + # Check commands/**/* files are executable + check_command_executability + # Check tests workflow check_tests_workflow From 87ac5b37a492f045850cd5b2160c2bd1e886c879 Mon Sep 17 00:00:00 2001 From: codebymikey <9484406+codebymikey@users.noreply.github.com> Date: Fri, 27 Mar 2026 15:13:03 +0000 Subject: [PATCH 2/4] Remove the . and _ prefixed file exceptions --- .github/scripts/update-checker.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/scripts/update-checker.sh b/.github/scripts/update-checker.sh index 9c4a016..0c35498 100755 --- a/.github/scripts/update-checker.sh +++ b/.github/scripts/update-checker.sh @@ -199,12 +199,11 @@ check_shebang() { } # Check that certain commands/**/* files are executable -# Files starting with . or _ are exempt as they might be include files check_command_executability() { local file while IFS= read -r -d '' file; do actions+=("$file should be executable") - done < <(find commands -type f \! -executable \! -name '.*' \! -name '_*' -print0 2>/dev/null || true) + done < <(find commands -type f \! -executable -print0 2>/dev/null || true) } # Check .github/workflows/tests.yml for required conditions From 1154cbc74a733826893539481ce423c973876486 Mon Sep 17 00:00:00 2001 From: Stanislav Zhuk Date: Wed, 8 Apr 2026 20:51:57 +0300 Subject: [PATCH 3/4] delete the executable file and check only files that have Usage --- .github/scripts/update-checker.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/scripts/update-checker.sh b/.github/scripts/update-checker.sh index 0c35498..5747625 100755 --- a/.github/scripts/update-checker.sh +++ b/.github/scripts/update-checker.sh @@ -202,8 +202,14 @@ check_shebang() { check_command_executability() { local file while IFS= read -r -d '' file; do - actions+=("$file should be executable") - done < <(find commands -type f \! -executable -print0 2>/dev/null || true) + if [[ -f "$file" && -r "$file" ]]; then + if grep -q "^## Usage:" "$file" 2>/dev/null; then + if [[ ! -x "$file" ]]; then + actions+=("$file should be executable, run 'chmod +x $file'") + fi + fi + fi + done < <(find commands -type f -print0 2>/dev/null || true) } # Check .github/workflows/tests.yml for required conditions From 24fcc19ec9301ce2286d2aa3df2e666b7010ed63 Mon Sep 17 00:00:00 2001 From: Stanislav Zhuk Date: Wed, 8 Apr 2026 21:07:31 +0300 Subject: [PATCH 4/4] check all files --- .github/scripts/update-checker.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/scripts/update-checker.sh b/.github/scripts/update-checker.sh index 5747625..9f9780a 100755 --- a/.github/scripts/update-checker.sh +++ b/.github/scripts/update-checker.sh @@ -202,12 +202,8 @@ check_shebang() { check_command_executability() { local file while IFS= read -r -d '' file; do - if [[ -f "$file" && -r "$file" ]]; then - if grep -q "^## Usage:" "$file" 2>/dev/null; then - if [[ ! -x "$file" ]]; then - actions+=("$file should be executable, run 'chmod +x $file'") - fi - fi + if [[ ! -x "$file" ]]; then + actions+=("$file should be executable, run 'chmod +x \"$file\"'") fi done < <(find commands -type f -print0 2>/dev/null || true) }