debug: Add extensive debugging to PHP version check
All checks were successful
Helm Chart Release / release-chart (push) Successful in 11s

- Add jq installation check and auto-install
- Output first 10 available PHP tags for debugging
- Show matched LATEST value before processing
- Store API response in variable for reuse

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-10 11:59:24 +09:00
parent 6002da51d0
commit a3f0245c64

View File

@@ -50,12 +50,28 @@ jobs:
echo "Current PHP: $CURRENT" echo "Current PHP: $CURRENT"
# Docker Hub API v2を使用してタグを取得 # Docker Hub API v2を使用してタグを取得
echo "Fetching tags from Docker Hub..."
RAW_RESPONSE=$(curl -s "https://registry.hub.docker.com/v2/repositories/library/php/tags?page_size=100")
# デバッグ: jqが利用可能か確認
if ! command -v jq &> /dev/null; then
echo "ERROR: jq is not installed"
echo "Installing jq..."
apt-get update && apt-get install -y jq
fi
# タグ一覧を取得してデバッグ出力
echo "DEBUG: Available PHP tags (first 10):"
echo "$RAW_RESPONSE" | jq -r '.results[].name' | grep 'fpm-alpine' | head -10
# パターン: 8.5.2-fpm-alpine3.23 形式alpineバージョンは2-3桁に対応 # パターン: 8.5.2-fpm-alpine3.23 形式alpineバージョンは2-3桁に対応
LATEST=$(curl -s "https://registry.hub.docker.com/v2/repositories/library/php/tags?page_size=100" | \ LATEST=$(echo "$RAW_RESPONSE" | \
jq -r '.results[].name' | \ jq -r '.results[].name' | \
grep -E '^[0-9]+\.[0-9]+\.[0-9]+-fpm-alpine[0-9]+\.[0-9]{2,3}$' | \ grep -E '^[0-9]+\.[0-9]+\.[0-9]+-fpm-alpine[0-9]+\.[0-9]{2,3}$' | \
sort -V | tail -1) sort -V | tail -1)
echo "DEBUG: Matched LATEST=$LATEST"
if [ -z "$LATEST" ]; then if [ -z "$LATEST" ]; then
echo "Warning: Could not fetch latest PHP version, using current" echo "Warning: Could not fetch latest PHP version, using current"
LATEST="$CURRENT" LATEST="$CURRENT"