build: ensure proper caching of buf tool

We use a wrapper and we include it in the hash for setup-go
This commit is contained in:
Vincent Bernat
2025-08-21 08:34:15 +02:00
parent 7fd2bbb03f
commit daaf419cef
3 changed files with 18 additions and 3 deletions

12
bin/external-tool Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
# Wrapper to execute an external tool. This is used a bit like "go tool", but in
# a case we don't want to put the dependency in go.mod (which may be considered
# by an anti-pattern for some tools).
cmd="$1"
shift
case "$cmd" in
buf) exec go run github.com/bufbuild/buf/cmd/buf@v1.55.1 "$@" ;;
esac