@@ -16,22 +16,25 @@ runs:
1616 steps :
1717 - name : Get latest upstream
1818 shell : bash
19+ env :
20+ IS_RELEASE : ${{ github.event.inputs.release || 'true' }}
21+ GH_CLI_TOKEN : ${{ inputs.gh_cli_token }}
1922 run : |
2023 sudo apt update
21- sudo apt install jq
22- AUTH_HEADER="Authorization: token ${{ inputs.gh_cli_token }}"
23- if [ "${{ inputs.release } }" = "true" ]; then
24+ sudo apt install gh
25+ echo "${GH_CLI_TOKEN}" | gh auth login --with-token
26+ if [ "${IS_RELEASE }" = "true" ]; then
2427 echo "Getting the latest stable release."
25- RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/ SeleniumHQ/selenium/releases | jq -r '[.[] | select(.prerelease == false)] | .[0].tag_name' )
28+ RELEASE=$(gh release list -R SeleniumHQ/selenium | grep -v nightly | awk '{ print $4 }' | head -1 )
2629 else
2730 echo "Getting the latest Nightly release."
28- RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/ SeleniumHQ/selenium/releases | jq -r '[.[] | select(.prerelease == true)] | .[0].tag_name' )
31+ RELEASE=$(gh release list -R SeleniumHQ/selenium | grep nightly | awk '{ print $3 }' | head -1 )
2932 if [ -z "${RELEASE}" ]; then
3033 echo "Nightly release not found, getting the latest stable release."
31- RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/ SeleniumHQ/selenium/releases | jq -r '[.[] | select(.prerelease == false)] | .[0].tag_name' )
34+ RELEASE=$(gh release list -R SeleniumHQ/selenium | grep -v nightly | awk '{ print $4 }' | head -1 )
3235 fi
3336 fi
34- jar_file=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/ SeleniumHQ/selenium/releases/tags/ ${RELEASE} | jq -r '.assets[] | select(.name | endswith(".jar")) | .name ' | tail -n 1)
37+ jar_file=$(gh release view -R SeleniumHQ/selenium ${RELEASE} | grep jar | awk '{ print $2 } ' | tail -n 1)
3538 echo "Server package: ${jar_file}"
3639 VERSION=$(echo $jar_file | sed 's/selenium-server-//;s/\.jar//')
3740 echo "BASE_RELEASE=${RELEASE} | BASE_VERSION=${VERSION} | VERSION=${VERSION}"
0 commit comments