mirror of
https://github.com/jlengrand/asdf-php.git
synced 2026-03-10 08:01:22 +00:00
Update list-all
This commit is contained in:
2
.github/workflows/workflow.yml
vendored
2
.github/workflows/workflow.yml
vendored
@@ -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 }}
|
||||
|
||||
16
bin/list-all
16
bin/list-all
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user