.github/actions/go-cache: check for pre-built cigocacher (#18833)

Some CI runner images now have cigocacher baked in. Skip building if
it's already present.

Updates tailscale/corp#35667

Change-Id: I5ea0d606d44b1373bc1c8f7bca4ab780e763e2a9

Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
main
Tom Proctor 2 months ago committed by GitHub
parent 48e0334aac
commit 2743e0b681
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .github/actions/go-cache/action.sh

@ -23,6 +23,10 @@ if [ -z "${URL:-}" ]; then
exit 0
fi
BIN_PATH="$(PATH="$PATH:$HOME/bin" command -v cigocacher || true)"
if [ -z "${BIN_PATH}" ]; then
echo "cigocacher not found in PATH, attempting to build or fetch it"
GOPATH=$(command -v go || true)
if [ -z "${GOPATH}" ]; then
if [ ! -f "tool/go" ]; then
@ -40,6 +44,7 @@ else
echo "cmd/cigocacher not found locally, fetching from tailscale.com/cmd/cigocacher"
"${GOPATH}" build -o "${BIN_PATH}" tailscale.com/cmd/cigocacher
fi
fi
CIGOCACHER_TOKEN="$("${BIN_PATH}" --auth --cigocached-url "${URL}" --cigocached-host "${HOST}" )"
if [ -z "${CIGOCACHER_TOKEN:-}" ]; then

Loading…
Cancel
Save