mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-30 13:32:46 -08:00
.github,cmd/cigocacher: read access token from env
Change-Id: Ic705fe496ae0616126f83d9a00a73ec9e6105cec Signed-off-by: Tom Proctor <[email protected]>
This commit is contained in:
2 files changed
+7
-2
No files matched your search
@@ -49,6 +49,7 @@ fi
|
||||
|
||||
echo "Fetched cigocacher token successfully"
|
||||
echo "::add-mask::${CIGOCACHER_TOKEN}"
|
||||
echo "CIGOCACHER_TOKEN=${CIGOCACHER_TOKEN}" >> "${GITHUB_ENV}"
|
||||
|
||||
echo "GOCACHEPROG=${BIN_PATH} --cache-dir ${CACHE_DIR} --cigocached-url ${URL} --cigocached-host ${HOST} --token ${CIGOCACHER_TOKEN}" >> "${GITHUB_ENV}"
|
||||
echo "GOCACHEPROG=${BIN_PATH} --cache-dir ${CACHE_DIR} --cigocached-url ${URL} --cigocached-host ${HOST}" >> "${GITHUB_ENV}"
|
||||
echo "success=true" >> "${GITHUB_OUTPUT}"
|
||||
@@ -40,13 +40,17 @@ func main() {
|
||||
version = flag.Bool("version", false, "print version and exit")
|
||||
auth = flag.Bool("auth", false, "auth with cigocached and exit, printing the access token as output")
|
||||
stats = flag.Bool("stats", false, "fetch and print cigocached stats and exit")
|
||||
token = flag.String("token", "", "the cigocached access token to use, as created using --auth")
|
||||
token = flag.String("token", "", "the cigocached access token to use, as created using --auth; defaults to CIGOCACHER_TOKEN env var if set")
|
||||
srvURL = flag.String("cigocached-url", "", "optional cigocached URL (scheme, host, and port). Empty means to not use one.")
|
||||
srvHostDial = flag.String("cigocached-host", "", "optional cigocached host to dial instead of the host in the provided --cigocached-url. Useful for public TLS certs on private addresses.")
|
||||
dir = flag.String("cache-dir", "", "cache directory; empty means automatic")
|
||||
verbose = flag.Bool("verbose", false, "enable verbose logging")
|
||||
)
|
||||
flag.Parse()
|
||||
// Default --token _after_ parsing flags so we don't print it in --help output.
|
||||
if *token == "" {
|
||||
*token = os.Getenv("CIGOCACHER_TOKEN")
|
||||
}
|
||||
|
||||
if *version {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
|
||||
Reference in new issue
Block a user