Skip to content

Commit 821c926

Browse files
committed
Fix php.net regex [skip ci]
1 parent 540a9f5 commit 821c926

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/build_partials/version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ get_stable_release_tag() {
2828
source=$1
2929
if [ "$source" = "--web-php" ]; then
3030
release_tag="$(curl -sL https://www.php.net/releases/feed.php | grep -Po -m 1 "php-(${PHP_VERSION//./\\.}\.[0-9]+)" | head -n 1)"
31-
echo "${release_tag:-$(curl -sL https://www.php.net/releases | grep -Po "${PHP_VERSION//./\\.}\.[0-9]+" | head -n1 | sed 's/^/php-/')}"
31+
echo "${release_tag:-$(curl -sL https://www.php.net/releases | grep -Po "<h2>\K${PHP_VERSION//./\\.}\.[0-9]+" | head -n1 | sed 's/^/php-/')}"
3232
else
3333
curl -H "Authorization: Bearer $GITHUB_TOKEN" -sL "https://api.github.com/repos/php/php-src/git/matching-refs/tags%2Fphp-$PHP_VERSION." | grep -Eo "php-[0-9]+\.[0-9]+\.[0-9]+\"" | tail -1 | cut -d '"' -f 1
3434
fi

scripts/check-php-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ get_stable_release_tag() {
55
source=$1
66
if [ "$source" = "--web-php" ]; then
77
release_tag="$(curl -sL https://www.php.net/releases/feed.php | grep -Po -m 1 "php-(${php_version//./\\.}\.[0-9]+)" | head -n 1)"
8-
echo "${release_tag:-$(curl -sL https://www.php.net/releases | grep -Po "${php_version//./\\.}\.[0-9]+" | head -n1 | sed 's/^/php-/')}"
8+
echo "${release_tag:-$(curl -sL https://www.php.net/releases | grep -Po "<h2>\K${php_version//./\\.}\.[0-9]+" | head -n1 | sed 's/^/php-/')}"
99
else
1010
curl -H "Authorization: Bearer $GITHUB_TOKEN" -sL "https://api.github.com/repos/php/php-src/git/matching-refs/tags%2Fphp-$php_version." | grep -Eo "php-[0-9]+\.[0-9]+\.[0-9]+\"" | tail -1 | cut -d '"' -f 1
1111
fi

0 commit comments

Comments
 (0)