diff --git a/.gitea/workflows/build-push.yaml b/.gitea/workflows/build-push.yaml index 9674d55..8d3a9d5 100644 --- a/.gitea/workflows/build-push.yaml +++ b/.gitea/workflows/build-push.yaml @@ -73,25 +73,26 @@ jobs: fi echo "smoke test passed" - # Lints run directly on the runner instead of via `docker run -v "$PWD:/src"` - # against the built image. Gitea runners are themselves containerized, - # so $PWD inside the runner is NOT a path the host docker daemon can bind - # mount; the previous approach surfaced as "Could not open input file" - # for every script. Running php/bash directly on the runner works because - # the runner image (ubuntu-latest) ships php-cli + bash, and the files - # exist in $PWD because the checkout step already populated them. + # Lints run inside the just-built image rather than on the runner side. + # The Dockerfile already COPYs scripts/ to /scripts/ inside the image, + # so we don't need a host bind mount (the original `docker run -v + # "$PWD:/src"` shape failed under Gitea's dockerized runner, where + # $PWD on the runner is not a path the host docker daemon can mount). + # Switching the path from /src/$f to /$f reads from the image's own + # /scripts/ rootfs entries directly. Runner-side `php -l` won't work + # because the act-based ubuntu-latest image doesn't ship php-cli. - name: PHP syntax check run: | set -euo pipefail for f in scripts/*.php scripts/lib/*.php; do - php -l "$f" + docker run --rm --entrypoint php cpanel-importer:smoke -l "/$f" done - name: Bash syntax check run: | set -euo pipefail for f in scripts/*.sh; do - bash -n "$f" + docker run --rm --entrypoint bash cpanel-importer:smoke -n "/$f" done - name: Build and Push Image