From a20c137a2e9c3bbcad05572793f7b49f35ae1fc7 Mon Sep 17 00:00:00 2001 From: "u102348 (Per Westling)" Date: Mon, 16 Mar 2026 14:07:13 +0000 Subject: [PATCH] Avoid unnecessary curl This commit will use curl to get the SHA for latest version of dagger, only if user has requested to use 'latest' version. If requesting a specific version the curl call is avoided. This will help to alleviate issue with Error 429 if using a specific dagger-for-github version. Signed-off-by: u102348 (Per Westling) --- action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index b72e309..a77955c 100644 --- a/action.yml +++ b/action.yml @@ -88,7 +88,6 @@ runs: # Add 'v' prefix if version doesn't start with 'v' and is not empty VERSION="v$VERSION" fi - latest=$(curl https://dl.dagger.io/dagger/versions/latest) COMMIT=${{ inputs.commit }} @@ -96,7 +95,11 @@ runs: echo "::group::Checking dagger" version="$(dagger --silent version | cut --fields 2 --delimiter ' ')" echo "Found existing dagger version: $version" - if [[ "$version" == "$VERSION" ]] || [[ "$version" == "$latest" ]]; then + if [[ -z "$VERSION" ]]; then + latest=$(curl -s https://dl.dagger.io/dagger/versions/latest) + fi + if [[ "$version" == "$VERSION" ]] || \ + [[ -z "$VERSION" && "$version" == "$latest" ]]; then echo "dagger ${version} is already installed, skipping installation" exit 0 fi