Enable telemetry without env var

This commit is contained in:
William Martin 2026-04-21 17:24:17 +02:00 committed by Babak K. Shandiz
parent 3a6d4de90a
commit 90ef03ea38
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E
11 changed files with 1 additions and 11 deletions

View file

@ -21,7 +21,6 @@ grep 'github-repo' $WORK/custom-skills/git-commit/SKILL.md
# Telemetry: skill_install event records agent hosts, repo identifiers,
# and (for a public repo) the installed skill name.
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100
exec gh skill install github/awesome-copilot git-commit --scope user --force --agent github-copilot

View file

@ -10,7 +10,6 @@ stderr 'not found'
# Telemetry: skill_preview event records repo identifiers and, for a
# public repo, the skill name.
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100
exec gh skill preview github/awesome-copilot git-commit

View file

@ -1,5 +1,4 @@
# Telemetry log mode outputs command invocation event to stderr
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

View file

@ -2,7 +2,6 @@
# resolved inner command should still record normally — its path is a core
# gh command and conveys no user-authored identifier.
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

View file

@ -1,5 +1,4 @@
# The completion command should not generate a telemetry event
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

View file

@ -3,7 +3,6 @@
# organization or project name).
[!exec:bash] skip
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

View file

@ -1,5 +1,4 @@
# GHES users should not get telemetry even when telemetry is enabled
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100
env GH_ENTERPRISE_TOKEN=fake-enterprise-token

View file

@ -1,5 +1,4 @@
# The send-telemetry command should not itself generate a telemetry event
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100
env GH_TELEMETRY_ENDPOINT_URL=http://localhost:1

View file

@ -1,5 +1,4 @@
# Command completes successfully even when telemetry endpoint is unreachable
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=enabled
env GH_TELEMETRY_SAMPLE_RATE=100
env GH_TELEMETRY_ENDPOINT_URL=http://localhost:1

View file

@ -3,7 +3,6 @@
# names come from a fixed, hard-coded registry and do not contain any
# user-authored identifiers.
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

View file

@ -84,7 +84,7 @@ func Main() exitCode {
telemetryService = &telemetry.NoOpService{}
default:
telemetryState := telemetry.ParseTelemetryState(cfg.Telemetry().Value)
telemetryDisabled := os.Getenv("GH_PRIVATE_ENABLE_TELEMETRY") == "" || mightBeGHESUser(cfg)
telemetryDisabled := mightBeGHESUser(cfg)
switch telemetryState {
case telemetry.Disabled: