From 53036ce036c1aa84a3c822bb8d53f990f6dfe484 Mon Sep 17 00:00:00 2001 From: Edoardo Pirovano Date: Fri, 3 Dec 2021 17:30:50 +0000 Subject: [PATCH] Minor code refactoring --- gh-codeql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gh-codeql b/gh-codeql index a837048..0275a06 100755 --- a/gh-codeql +++ b/gh-codeql @@ -97,10 +97,10 @@ function get_latest() { if [ "$channel" = "release" ]; then # For the release channel, we sort by semantic version order since the tags correspond to release versions. # We ignore draft releases and pre-release versions in this case since we want to give the user a stable version. - echo $(gh api "repos/$repo/releases" --paginate --jq ".[] | select(.draft == false and .prerelease == false) | .tag_name" | sort -V | tail -1) + gh api "repos/$repo/releases" --paginate --jq ".[] | select(.draft == false and .prerelease == false) | .tag_name" | sort -V | tail -1 else # For the nightly channel, we just take the latest release since the tags there are not semantic versions. - echo $(gh api "repos/$repo/releases" --jq ".[].tag_name" | head -1) + gh api "repos/$repo/releases" --jq ". | first | .tag_name" fi }