File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ inputs:
4848 description : ' Timeout for `tailscale up`'
4949 required : false
5050 default : ' 2m'
51+ retry :
52+ description : ' Number of retries for `tailscale up`'
53+ required : false
54+ default : ' 5'
5155 use-cache :
5256 description : ' Whether to cache the Tailscale binaries (Linux/macOS) or installer (Windows)'
5357 required : false
@@ -293,6 +297,7 @@ runs:
293297 HOSTNAME : ${{ inputs.hostname }}
294298 TAILSCALE_AUTHKEY : ${{ inputs.authkey }}
295299 TIMEOUT : ${{ inputs.timeout }}
300+ RETRY : ${{ inputs.retry }}
296301 run : |
297302 if [ -z "${HOSTNAME}" ]; then
298303 if [ "${{ runner.os }}" == "Windows" ]; then
@@ -308,4 +313,9 @@ runs:
308313 if [ "${{ runner.os }}" != "Windows" ]; then
309314 MAYBE_SUDO="sudo -E"
310315 fi
311- timeout --verbose --kill-after=1s ${TIMEOUT} ${MAYBE_SUDO} tailscale up ${TAGS_ARG} --authkey=${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes ${ADDITIONAL_ARGS}
316+ for ((i=1;i<=$RETRY;i++)); do
317+ echo "Attempt $i to bring up Tailscale..."
318+ timeout --verbose --kill-after=1s ${TIMEOUT} ${MAYBE_SUDO} tailscale up ${TAGS_ARG} --authkey=${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes ${ADDITIONAL_ARGS} && break
319+ echo "Tailscale up failed. Retrying in $((i * 5)) seconds..."
320+ sleep $((i * 5))
321+ done
You can’t perform that action at this time.
0 commit comments