From 5615e0285985d59eb5ac73beb002c43868b571b3 Mon Sep 17 00:00:00 2001 From: Weii Wang Date: Mon, 26 Jan 2026 21:32:15 +0800 Subject: [PATCH 1/5] only install/refresh lxd snap when needed --- action.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index d5e720c..2f02213 100644 --- a/action.yaml +++ b/action.yaml @@ -74,8 +74,10 @@ runs: shell: bash run: | sudo iptables -I DOCKER-USER -j ACCEPT - sudo snap install lxd - sudo snap refresh lxd + if snap list lxd 2> /dev/null; then + sudo snap refresh lxd + else + sudo snap install lxd sudo lxd waitready sudo lxd init --auto sudo lxc project create devstack -c features.images=false From 1ea6ac0ae205ba1b08c73b0685622c28304186c2 Mon Sep 17 00:00:00 2001 From: Weii Wang Date: Mon, 26 Jan 2026 21:36:49 +0800 Subject: [PATCH 2/5] Fix bash --- action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yaml b/action.yaml index 2f02213..7b6b218 100644 --- a/action.yaml +++ b/action.yaml @@ -78,6 +78,7 @@ runs: sudo snap refresh lxd else sudo snap install lxd + fi sudo lxd waitready sudo lxd init --auto sudo lxc project create devstack -c features.images=false From 45d384a4730f0ed5da90302da0faca817a31a955 Mon Sep 17 00:00:00 2001 From: Weii Wang Date: Mon, 26 Jan 2026 21:44:59 +0800 Subject: [PATCH 3/5] Pin version --- action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 7b6b218..37cbf60 100644 --- a/action.yaml +++ b/action.yaml @@ -75,9 +75,9 @@ runs: run: | sudo iptables -I DOCKER-USER -j ACCEPT if snap list lxd 2> /dev/null; then - sudo snap refresh lxd + sudo snap refresh lxd --channel 5.21/stable else - sudo snap install lxd + sudo snap install lxd --channel 5.21/stable fi sudo lxd waitready sudo lxd init --auto From 5a232ae7901f3d59cd4dda300c1e73ff032ba062 Mon Sep 17 00:00:00 2001 From: Weii Wang Date: Tue, 27 Jan 2026 00:28:01 +0800 Subject: [PATCH 4/5] Retry --- action.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 37cbf60..188b1b2 100644 --- a/action.yaml +++ b/action.yaml @@ -75,9 +75,23 @@ runs: run: | sudo iptables -I DOCKER-USER -j ACCEPT if snap list lxd 2> /dev/null; then - sudo snap refresh lxd --channel 5.21/stable + for i in {1..10}; do + if [ $i == 10 ] + sudo snap refresh lxd --channel 5.21/stable + else + sudo snap refresh lxd --channel 5.21/stable && break || : + fi + sleep 5 + done else - sudo snap install lxd --channel 5.21/stable + for i in {1..10}; do + if [ $i == 10 ] + sudo snap install lxd --channel 5.21/stable + else + sudo snap install lxd --channel 5.21/stable && break || : + fi + sleep 5 + done fi sudo lxd waitready sudo lxd init --auto From 2450f4f6f683155b8b5b9dcd9153fb8f0a033a5a Mon Sep 17 00:00:00 2001 From: Weii Wang Date: Tue, 27 Jan 2026 00:28:25 +0800 Subject: [PATCH 5/5] Retry --- action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 188b1b2..f862e40 100644 --- a/action.yaml +++ b/action.yaml @@ -76,7 +76,7 @@ runs: sudo iptables -I DOCKER-USER -j ACCEPT if snap list lxd 2> /dev/null; then for i in {1..10}; do - if [ $i == 10 ] + if [ $i == 10 ]; then sudo snap refresh lxd --channel 5.21/stable else sudo snap refresh lxd --channel 5.21/stable && break || : @@ -85,7 +85,7 @@ runs: done else for i in {1..10}; do - if [ $i == 10 ] + if [ $i == 10 ]; then sudo snap install lxd --channel 5.21/stable else sudo snap install lxd --channel 5.21/stable && break || :