From 14d1597bc676e775d2729da639125d3fe8648592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Wed, 17 Jan 2024 10:23:15 +0100 Subject: [PATCH] Always use `latest` tool version --- .github/workflows/main.yml | 1 + action.yml | 2 +- entrypoint.sh | 10 +++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 323c201..f715fb6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -90,6 +90,7 @@ jobs: if: github.event_name == 'pull_request' with: configuration: runtimeClasspath + lib-version: "1.2.1" build-root-directory: testproject additional-gradle-arguments: "--no-configuration-cache --stacktrace" project: "" diff --git a/action.yml b/action.yml index 2622797..69c2e06 100644 --- a/action.yml +++ b/action.yml @@ -16,7 +16,7 @@ inputs: lib-version: description: 'Dependency diff library version' required: true - default: '1.2.1' + default: 'latest' additional-gradle-arguments: description: 'Additional arguments passed to gradle commands' required: false diff --git a/entrypoint.sh b/entrypoint.sh index e4c8952..5071433 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,15 @@ cd "$INPUT_BUILD_ROOT_DIR" -wget "https://github.com/JakeWharton/dependency-tree-diff/releases/download/$INPUT_VERSION/dependency-tree-diff.jar" -q -O dependency-tree-diff.jar +if [ "$INPUT_VERSION" == "latest" ]; then + curl -s https://api.github.com/repos/JakeWharton/dependency-tree-diff/releases/latest \ + | grep "/dependency-tree-diff.jar" \ + | cut -d : -f 2,3 \ + | tr -d \" \ + | wget -qi -O dependency-tree-diff.jar - +else + wget "https://github.com/JakeWharton/dependency-tree-diff/releases/download/$INPUT_VERSION/dependency-tree-diff.jar" -q -O dependency-tree-diff.jar + fi if [ "$INPUT_PROJECT" == ":" ]; then INPUT_PROJECT=""