Skip to content

Commit 37554a2

Browse files
committed
[ci]: Fix in case Nightly release not available
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
1 parent 1b09d1c commit 37554a2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/actions/get-latest-upstream/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ runs:
2222
AUTH_HEADER="Authorization: token ${{ inputs.gh_cli_token }}"
2323
if [ "${{ inputs.release }}" = "true" ]; then
2424
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')
25+
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/SeleniumHQ/selenium/releases | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
2626
else
2727
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' || echo "")
29-
if [ -z "${RELEASE}" ]; then
28+
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/SeleniumHQ/selenium/releases | jq -r '[.[]? | select(.prerelease == true)] | .[0].tag_name' || echo "")
29+
if [ -z "${RELEASE}" ] || [ "${RELEASE}" = "null" ]; then
3030
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')
31+
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/SeleniumHQ/selenium/releases | jq -r '[.[]? | select(.prerelease == false)] | .[0].tag_name')
3232
fi
3333
fi
3434
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)

0 commit comments

Comments
 (0)