Skip to content

Commit

Permalink
add timeout on steps with network I/O
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
willnorris committed Jun 29, 2023
1 parent 62fddff commit 65cdd9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}

0 comments on commit 65cdd9a

Please sign in to comment.