Skip to content

Commit

Permalink
Fix json formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
craigpearson committed May 26, 2024
1 parent 3f78916 commit 46c84ec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ jobs:
id: set-php-versions
run: |
MIN_PHP_VERSION=${{ env.PHP_VERSION }}
PHP_VERSIONS=$(curl -s https://api.github.com/repos/php/php-src/git/refs/tags | jq -r '.[].ref' | grep -E 'refs/tags/php-[0-9]+\.[0-9]+\.[0-9]+$' | sed 's#refs/tags/php-##' | grep -vE 'alpha|beta|rc' | awk -v min=$MIN_PHP_VERSION '$1 >= min' | jq -cR '[split("\n")[] | select(length > 0)]')
echo "versions=${PHP_VERSIONS}" >> $GITHUB_OUTPUT
PHP_VERSIONS=$(curl -s https://api.github.com/repos/php/php-src/git/refs/tags | jq -r '.[].ref' | grep -E 'refs/tags/php-[0-9]+\.[0-9]+\.[0-9]+$' | sed 's#refs/tags/php-##' | grep -vE 'alpha|beta|rc' | awk -v min=$MIN_PHP_VERSION '$1 >= min')
PHP_VERSIONS_JSON=$(echo $PHP_VERSIONS | jq -Rnc '[inputs | split("\n") | .[] | select(length > 0)]')
echo "versions=${PHP_VERSIONS_JSON}" >> $GITHUB_OUTPUT
- name: Fetch available WP versions
id: set-wp-versions
run: |
MIN_WP_VERSION=${{ env.WP_VERSION }}
WP_VERSIONS=$(curl -s https://api.github.com/repos/WordPress/WordPress/git/refs/tags | jq -r '.[].ref' | grep -E 'refs/tags/[0-9]+\.[0-9]+\.[0-9]+$' | sed 's#refs/tags/##' | awk -v min=$MIN_WP_VERSION '$1 >= min' | jq -cR '[split("\n")[] | select(length > 0)]')
echo "versions=${WP_VERSIONS}" >> $GITHUB_OUTPUT
WP_VERSIONS=$(curl -s https://api.github.com/repos/WordPress/WordPress/git/refs/tags | jq -r '.[].ref' | grep -E 'refs/tags/[0-9]+\.[0-9]+\.[0-9]+$' | sed 's#refs/tags/##' | awk -v min=$MIN_WP_VERSION '$1 >= min')
WP_VERSIONS_JSON=$(echo $WP_VERSIONS | jq -Rnc '[inputs | split("\n") | .[] | select(length > 0)]')
echo "versions=${WP_VERSIONS_JSON}" >> $GITHUB_OUTPUT
run-tests:
needs: fetch-versions
Expand Down

0 comments on commit 46c84ec

Please sign in to comment.