add timeout on steps with network I/O

Set a reasonable timeout to prevent jobs from hanging for hours (#50).
5 minutes is way longer than should ever be necessary, but accounts for
intermittent networking issues on either the actions runner or the
Tailscale package or control server.  Users can always set a shorter
timeout on their own action step.

Fixes #50

Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
Will Norris 2023-06-29 10:09:39 -07:00 committed by Will Norris
parent 62fddffa64
commit 65cdd9a05d

View file

@ -82,7 +82,7 @@ runs:
if ! [[ "$SHA256SUM" ]] ; then
SHA256SUM="$(curl "${URL}.sha256")"
fi
curl "$URL" -o tailscale.tgz
curl "$URL" -o tailscale.tgz --max-time 300
echo "$SHA256SUM tailscale.tgz" | sha256sum -c
tar -C /tmp -xzf tailscale.tgz
rm tailscale.tgz
@ -113,4 +113,4 @@ runs:
TAILSCALE_AUTHKEY="${{ inputs['oauth-secret'] }}?preauthorized=true&ephemeral=true"
TAGS_ARG="--advertise-tags=${{ inputs.tags }}"
fi
sudo -E tailscale up ${TAGS_ARG} --authkey=${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes ${ADDITIONAL_ARGS}
timeout 5m sudo -E tailscale up ${TAGS_ARG} --authkey=${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes ${ADDITIONAL_ARGS}