diff --git a/action.yaml b/action.yaml index b3be546..25da172 100644 --- a/action.yaml +++ b/action.yaml @@ -27,7 +27,7 @@ inputs: cli-version: description: The version of the uploader to use. required: false - default: 0.6.19 + default: latest team: description: Value to tag team owner of upload. required: false diff --git a/script.sh b/script.sh index a15af63..4bbeb4c 100755 --- a/script.sh +++ b/script.sh @@ -77,7 +77,10 @@ QUARANTINE_ARG=$(parse_bool "${QUARANTINE}" "--use-quarantining") # CLI. set -x -if [[ ! (-f ./trunk-analytics-cli) ]]; then +if [[ ${CLI_VERSION} == "latest" ]]; then + curl -fsSL --retry 3 "https://github.com/trunk-io/analytics-cli/releases/latest/download/trunk-analytics-cli-${bin}.tar.gz" -o ./trunk-analytics-cli.tar.gz + tar -xvzf trunk-analytics-cli.tar.gz +elif [[ ! (-f ./trunk-analytics-cli) ]]; then curl -fsSL --retry 3 "https://github.com/trunk-io/analytics-cli/releases/download/${CLI_VERSION}/trunk-analytics-cli-${bin}.tar.gz" -o ./trunk-analytics-cli.tar.gz tar -xvzf trunk-analytics-cli.tar.gz fi diff --git a/tests/arguments.test.ts b/tests/arguments.test.ts index 8d57d5c..a537190 100644 --- a/tests/arguments.test.ts +++ b/tests/arguments.test.ts @@ -58,7 +58,8 @@ test("Forwards inputs", async () => { expect({ stdout, stderr, exit_code }).toMatchObject({ stdout: "upload --junit-paths junit.xml --org-url-slug org --token token --repo-root --team --tags", - stderr: `+ [[ -f ./trunk-analytics-cli ]] + stderr: `+ [[ 0.0.0 == \\l\\a\\t\\e\\s\\t ]] ++ [[ -f ./trunk-analytics-cli ]] + chmod +x ./trunk-analytics-cli + set +x `,