From c073fcc90bf275d7d305adf5ce1ffae25e3d2187 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 16 Sep 2026 11:53:56 +0000 Subject: [PATCH 1/5] retry docker pull before running container --- action.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/action.yml b/action.yml index bc74f024..55c6e0ae 100644 --- a/action.yml +++ b/action.yml @@ -82,6 +82,33 @@ runs: run: docker load -i /tmp/image shell: bash + - name: "Pull image" + # docker run pulls the image itself, but gives up after a single attempt, + # so a transient registry error fails the whole job. Pull it here with + # retries instead, leaving docker run to find the image already present. + env: + IMAGE: ${{ inputs.image || (inputs.artifact && 'quickstart' || 'docker.io/stellar/quickstart') }}:${{ inputs.tag }} + run: | + if docker image inspect "$IMAGE" > /dev/null 2>&1; then + echo "$IMAGE is already present" + exit 0 + fi + delay=2 + for attempt in 1 2 3 4 5; do + if docker pull "$IMAGE"; then + exit 0 + fi + if [ "$attempt" -eq 5 ]; then + break + fi + echo "docker pull failed (attempt $attempt of 5), retrying in ${delay}s" + sleep "$delay" + delay=$(( delay * 2 )) + done + echo "::error::docker pull of $IMAGE failed after 5 attempts" + exit 1 + shell: bash + - run: > docker run -d --name stellar -p 8000:8000 From 27978a308676d55a3bea880813e9136d6263fd9b Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 16 Sep 2026 12:09:58 +0000 Subject: [PATCH 2/5] resolve image ref once into IMAGE env var --- action.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/action.yml b/action.yml index 55c6e0ae..baf4e8a2 100644 --- a/action.yml +++ b/action.yml @@ -82,31 +82,27 @@ runs: run: docker load -i /tmp/image shell: bash + - name: "Resolve image" + env: + IMAGE: ${{ inputs.image || (inputs.artifact && 'quickstart' || 'docker.io/stellar/quickstart') }}:${{ inputs.tag }} + run: echo "IMAGE=$IMAGE" >> "$GITHUB_ENV" + shell: bash + - name: "Pull image" # docker run pulls the image itself, but gives up after a single attempt, # so a transient registry error fails the whole job. Pull it here with # retries instead, leaving docker run to find the image already present. - env: - IMAGE: ${{ inputs.image || (inputs.artifact && 'quickstart' || 'docker.io/stellar/quickstart') }}:${{ inputs.tag }} run: | if docker image inspect "$IMAGE" > /dev/null 2>&1; then echo "$IMAGE is already present" exit 0 fi - delay=2 - for attempt in 1 2 3 4 5; do - if docker pull "$IMAGE"; then - exit 0 - fi - if [ "$attempt" -eq 5 ]; then - break - fi - echo "docker pull failed (attempt $attempt of 5), retrying in ${delay}s" + for delay in 2 4 8 16; do + docker pull "$IMAGE" && exit 0 + echo "docker pull failed, retrying in ${delay}s" sleep "$delay" - delay=$(( delay * 2 )) done - echo "::error::docker pull of $IMAGE failed after 5 attempts" - exit 1 + docker pull "$IMAGE" shell: bash - run: > @@ -128,7 +124,7 @@ runs: --health-interval ${{ inputs.health_interval }}s --health-timeout ${{ inputs.health_timeout }}s --health-retries ${{ inputs.health_retries }} - ${{ inputs.image || (inputs.artifact && 'quickstart' || 'docker.io/stellar/quickstart') }}:${{ inputs.tag }} + "$IMAGE" shell: bash - name: "Wait for container to be healthy" From 49e177504b5f2a341e09ad99804d2ab306323166 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 16 Sep 2026 12:12:01 +0000 Subject: [PATCH 3/5] pass resolved image ref as a step output --- action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index baf4e8a2..0bc94010 100644 --- a/action.yml +++ b/action.yml @@ -83,15 +83,18 @@ runs: shell: bash - name: "Resolve image" + id: resolve env: IMAGE: ${{ inputs.image || (inputs.artifact && 'quickstart' || 'docker.io/stellar/quickstart') }}:${{ inputs.tag }} - run: echo "IMAGE=$IMAGE" >> "$GITHUB_ENV" + run: echo "image=$IMAGE" >> "$GITHUB_OUTPUT" shell: bash - name: "Pull image" # docker run pulls the image itself, but gives up after a single attempt, # so a transient registry error fails the whole job. Pull it here with # retries instead, leaving docker run to find the image already present. + env: + IMAGE: ${{ steps.resolve.outputs.image }} run: | if docker image inspect "$IMAGE" > /dev/null 2>&1; then echo "$IMAGE is already present" @@ -124,7 +127,7 @@ runs: --health-interval ${{ inputs.health_interval }}s --health-timeout ${{ inputs.health_timeout }}s --health-retries ${{ inputs.health_retries }} - "$IMAGE" + ${{ steps.resolve.outputs.image }} shell: bash - name: "Wait for container to be healthy" From dd1769a0d24b46756cb04a5340640f8a72b1b348 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 16 Sep 2026 12:25:37 +0000 Subject: [PATCH 4/5] pass image to docker run via env var --- action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 0bc94010..dfcbcbb8 100644 --- a/action.yml +++ b/action.yml @@ -108,7 +108,9 @@ runs: docker pull "$IMAGE" shell: bash - - run: > + - env: + IMAGE: ${{ steps.resolve.outputs.image }} + run: > docker run -d --name stellar -p 8000:8000 -p 11626:11626 @@ -127,7 +129,7 @@ runs: --health-interval ${{ inputs.health_interval }}s --health-timeout ${{ inputs.health_timeout }}s --health-retries ${{ inputs.health_retries }} - ${{ steps.resolve.outputs.image }} + "$IMAGE" shell: bash - name: "Wait for container to be healthy" From 7e374dc4305f6ada3a55d23ba1fc051414f46fe7 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 16 Sep 2026 12:37:47 +0000 Subject: [PATCH 5/5] reference resolved image output directly --- action.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index dfcbcbb8..ab946caa 100644 --- a/action.yml +++ b/action.yml @@ -93,24 +93,20 @@ runs: # docker run pulls the image itself, but gives up after a single attempt, # so a transient registry error fails the whole job. Pull it here with # retries instead, leaving docker run to find the image already present. - env: - IMAGE: ${{ steps.resolve.outputs.image }} run: | - if docker image inspect "$IMAGE" > /dev/null 2>&1; then - echo "$IMAGE is already present" + if docker image inspect "${{ steps.resolve.outputs.image }}" > /dev/null 2>&1; then + echo "${{ steps.resolve.outputs.image }} is already present" exit 0 fi for delay in 2 4 8 16; do - docker pull "$IMAGE" && exit 0 + docker pull "${{ steps.resolve.outputs.image }}" && exit 0 echo "docker pull failed, retrying in ${delay}s" sleep "$delay" done - docker pull "$IMAGE" + docker pull "${{ steps.resolve.outputs.image }}" shell: bash - - env: - IMAGE: ${{ steps.resolve.outputs.image }} - run: > + - run: > docker run -d --name stellar -p 8000:8000 -p 11626:11626 @@ -129,7 +125,7 @@ runs: --health-interval ${{ inputs.health_interval }}s --health-timeout ${{ inputs.health_timeout }}s --health-retries ${{ inputs.health_retries }} - "$IMAGE" + ${{ steps.resolve.outputs.image }} shell: bash - name: "Wait for container to be healthy"