From b34d453b82388ca8ea631091631e64c07b1aaaf0 Mon Sep 17 00:00:00 2001 From: Jesse Bye <8467862+jessebye@users.noreply.github.com> Date: Fri, 24 Oct 2025 12:48:08 -0700 Subject: [PATCH 1/2] fix: more resilient apt commands --- action.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 03a75b3..b644d21 100644 --- a/action.yml +++ b/action.yml @@ -25,10 +25,25 @@ runs: if: runner.os == 'Linux' shell: bash run: | - sudo apt update + # Add Twingate repository echo "deb [trusted=yes] https://packages.twingate.com/apt/ /" | sudo tee /etc/apt/sources.list.d/twingate.list - sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/twingate.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" - sudo apt install -yq twingate + + # Retry apt-get update up to 5 times with exponential backoff + max_retries=5 + delay=5 + for i in $(seq 1 $max_retries); do + if sudo apt-get update; then + echo "apt-get update succeeded" + break + else + echo "apt-get update failed, retrying ($i/$max_retries) in $delay seconds..." + sleep $delay + delay=$((delay * 2)) # exponential backoff + fi + done + + # Install Twingate + sudo apt-get -o DPkg::Lock::Timeout=60 install -y twingate - name: Setup and start Twingate (Linux) if: runner.os == 'Linux' @@ -90,4 +105,4 @@ runs: Start-Service twingate.service Start-Sleep -Seconds 14 - Get-Service twingate.service \ No newline at end of file + Get-Service twingate.service From 25fb06241414c551e741726440ba599afd387b1e Mon Sep 17 00:00:00 2001 From: Jesse Bye <8467862+jessebye@users.noreply.github.com> Date: Fri, 24 Oct 2025 12:50:27 -0700 Subject: [PATCH 2/2] cleanup --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b644d21..dfe0b20 100644 --- a/action.yml +++ b/action.yml @@ -43,7 +43,7 @@ runs: done # Install Twingate - sudo apt-get -o DPkg::Lock::Timeout=60 install -y twingate + sudo apt-get -yq -o DPkg::Lock::Timeout=60 install twingate - name: Setup and start Twingate (Linux) if: runner.os == 'Linux'