Simplify image version tag extraction
Publish PHP Apache image / Build, test and push (push) Successful in 46s

This commit is contained in:
2026-09-10 20:21:16 +02:00
parent 5e5cb9bb0d
commit 0396053c47
+10 -8
View File
@@ -85,15 +85,17 @@ jobs:
COMMIT_SHA: ${{ gitea.sha }}
run: |
set -euo pipefail
version_tag="$(
docker run --rm --entrypoint sh "${IMAGE}:${COMMIT_SHA}" -ec '
apache_version="$(httpd -v | sed -n "s#^Server version: Apache/\([0-9.]*\).*$#\1#p")"
php_version="$(php -r "echo PHP_VERSION;")"
test -n "${apache_version}"
test -n "${php_version}"
printf "%s-%s" "${apache_version}" "${php_version}"
'
apache_version="$(
docker run --rm --entrypoint httpd "${IMAGE}:${COMMIT_SHA}" -v \
| sed -n 's#^Server version: Apache/\([0-9.]*\).*$#\1#p'
)"
php_version="$(
docker run --rm --entrypoint php "${IMAGE}:${COMMIT_SHA}" \
-r 'echo PHP_VERSION;'
)"
test -n "${apache_version}"
test -n "${php_version}"
version_tag="${apache_version}-${php_version}"
printf 'VERSION_TAG=%s\n' "${version_tag}" >> "${GITHUB_ENV}"
run_attempt="${GITHUB_RUN_ATTEMPT:-1}"
test -n "${GITHUB_RUN_NUMBER}"