Update list-all

This commit is contained in:
BSKY
2020-02-13 12:26:28 +09:00
parent bbb9d82ad0
commit da507db99d
2 changed files with 8 additions and 10 deletions

View File

@@ -41,5 +41,3 @@ jobs:
uses: asdf-vm/actions/plugin-test@v1.0.0
with:
command: php --version
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -18,18 +18,18 @@
set -eo pipefail
cmd="curl --silent --location"
releases_path="https://api.github.com/repos/php/php-src/git/refs/tags"
if [ -n "$GITHUB_API_TOKEN" ]; then
cmd="$cmd --header 'Authorization: token $GITHUB_API_TOKEN'"
fi
sort_versions() {
sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' |
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}'
}
versions=$(eval "$cmd $releases_path" | grep '"ref": "refs/tags/php-' | tr -d '"ref": "refs/tags/php-' | tr -d ',' | sort_versions | xargs)
versions=$(
git ls-remote --tags https://github.com/php/php-src.git |
grep 'php-' |
awk '!/({})/ {print $2}' |
awk 'gsub("(refs/tags/)|(php-)", "")' |
sort_versions |
xargs
)
echo "$versions"