Skip to content

Commit e44bc62

Browse files
committed
Update PHP version fetching method to use releases from php.net
1 parent 7b03317 commit e44bc62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/docker.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ jobs:
106106
run: |
107107
export PATH="$PATH:$HOME/.composer/vendor/bin"
108108
PHP_CONSTRAINT=$(jq -r '.require.php' composer.json)
109-
# Get all PHP tags from Docker Hub (paginated, up to 1000 tags)
110-
TAGS=$(curl -s 'https://registry.hub.docker.com/v2/repositories/library/php/tags?page_size=1000' | jq -r '.results[].name')
111-
# Filter for fpm-alpine tags and extract version numbers
112-
VERSIONS=$(echo "$TAGS" | grep -E '^[0-9]+\.[0-9]+(\.[0-9]+)?-fpm-alpine$' | sed 's/-fpm-alpine//' | sort -V)
109+
# Fetch all PHP releases from php.net (JSON)
110+
RELEASES=$(curl -s 'https://www.php.net/releases/index.php?json&max=1000')
111+
# Extract all version fields from the JSON and sort
112+
VERSIONS=$(echo "$RELEASES" | jq -r '.[] | select(.version != null) | .version' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V)
113113
# Use composer/semver to find the highest matching version
114114
MATCH=$(echo "$VERSIONS" | xargs -I{} semver "$PHP_CONSTRAINT" {} | tail -n1)
115115
if [ -z "$MATCH" ]; then

0 commit comments

Comments
 (0)