Skip to content

Commit 132f0a5

Browse files
authored
Always point to latest CLI (#81)
1 parent 11b0d19 commit 132f0a5

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ inputs:
2727
cli-version:
2828
description: The version of the uploader to use.
2929
required: false
30-
default: 0.6.19
30+
default: latest
3131
team:
3232
description: Value to tag team owner of upload.
3333
required: false

script.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ QUARANTINE_ARG=$(parse_bool "${QUARANTINE}" "--use-quarantining")
7777

7878
# CLI.
7979
set -x
80-
if [[ ! (-f ./trunk-analytics-cli) ]]; then
80+
if [[ ${CLI_VERSION} == "latest" ]]; then
81+
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
82+
tar -xvzf trunk-analytics-cli.tar.gz
83+
elif [[ ! (-f ./trunk-analytics-cli) ]]; then
8184
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
8285
tar -xvzf trunk-analytics-cli.tar.gz
8386
fi

tests/arguments.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ test("Forwards inputs", async () => {
5858
expect({ stdout, stderr, exit_code }).toMatchObject({
5959
stdout:
6060
"upload --junit-paths junit.xml --org-url-slug org --token token --repo-root --team --tags",
61-
stderr: `+ [[ -f ./trunk-analytics-cli ]]
61+
stderr: `+ [[ 0.0.0 == \\l\\a\\t\\e\\s\\t ]]
62+
+ [[ -f ./trunk-analytics-cli ]]
6263
+ chmod +x ./trunk-analytics-cli
6364
+ set +x
6465
`,

0 commit comments

Comments
 (0)