Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(ci): stop a telemetry token blip failing CI (#99787)

posthog[bot]6f34ff1aac37
diff --git a/.depot/workflows/ci-backend.yml b/.depot/workflows/ci-backend.yml
index aebf4fdbd77e..56ec1526b05f 100644
--- a/.depot/workflows/ci-backend.yml
+++ b/.depot/workflows/ci-backend.yml
@@ -21,7 +21,10 @@
# capture-test-selection job — turbo-discover still emits its telemetry outputs to
# stay apples-to-apples, they just have no consumer here; canonical mints the
# telemetry token from the GH_APP_TELEMETRY_APP_ID org variable rather than the
-# secret, which the shadow has no token step to mirror),
+# secret, which the shadow has no token step to mirror. Canonical also makes that
+# mint fail open, falls its consumers back to github.token, and narrows
+# calculate-running-time to contents/actions read. The shadow has neither the step
+# nor the job, so all three are depot-exempt),
# --store-durations write, test-selection verdict (so the guard skipping it when both
# test matrices were skipped has nothing to mirror), Trunk flaky-test quarantine
# gate (canonical runs per-shard analytics-uploader steps that post to the
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml
index 152fc78d330e..d333fead377b 100644
--- a/.github/workflows/ci-backend.yml
+++ b/.github/workflows/ci-backend.yml
@@ -4164,10 +4164,14 @@ jobs:
!cancelled() && github.actor != 'dependabot[bot]' && (
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'PostHog/posthog') ||
(github.event_name != 'pull_request' && github.repository == 'PostHog/posthog'))
+ permissions:
+ contents: read
+ actions: read
steps:
- name: Get telemetry app token
id: telemetry-app-token
if: github.run_attempt == '1'
+ continue-on-error: true
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
client-id: ${{ vars.GH_APP_TELEMETRY_APP_ID }}
@@ -4181,7 +4185,7 @@ jobs:
event: 'posthog-ci-running-time'
capture-run-duration: true
capture-job-durations: true
- github-token: ${{ steps.telemetry-app-token.outputs.token }}
+ github-token: ${{ steps.telemetry-app-token.outputs.token || github.token }}
status-job: 'Django Tests Pass'
runner: 'depot'
- name: Capture running time to DevEx PostHog
@@ -4193,7 +4197,7 @@ jobs:
event: 'posthog-ci-running-time'
capture-run-duration: true
capture-job-durations: true
- github-token: ${{ steps.telemetry-app-token.outputs.token }}
+ github-token: ${{ steps.telemetry-app-token.outputs.token || github.token }}
status-job: 'Django Tests Pass'
runner: 'depot'
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index 40f0dcd39781..d9ca8ef28e02 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -1184,23 +1184,28 @@ jobs:
needs.changes.outputs.shouldRun == 'true' && (
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'PostHog/posthog') ||
(github.event_name != 'pull_request' && github.repository == 'PostHog/posthog')) }}
+ permissions:
+ contents: read
+ actions: read
steps:
- name: Get telemetry app token
id: telemetry-app-token
if: github.run_attempt == '1'
+ continue-on-error: true
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
client-id: ${{ vars.GH_APP_TELEMETRY_APP_ID }}
private-key: ${{ secrets.GH_APP_TELEMETRY_PRIVATE_KEY }}
- name: Capture running time to PostHog
if: github.run_attempt == '1'
+ continue-on-error: true
uses: PostHog/posthog-github-action@58dea254b598fb5d469c0699c98af8288a7f7650 # v1.2.0
with:
posthog-token: ${{ secrets.POSTHOG_API_TOKEN }}
event: 'posthog-ci-running-time'
capture-run-duration: true
capture-job-durations: true
- github-token: ${{ steps.telemetry-app-token.outputs.token }}
+ github-token: ${{ steps.telemetry-app-token.outputs.token || github.token }}
status-job: 'Playwright tests pass'
runner: 'depot'
- name: Capture running time to DevEx PostHog
@@ -1212,7 +1217,7 @@ jobs:
event: 'posthog-ci-running-time'
capture-run-duration: true
capture-job-durations: true
- github-token: ${{ steps.telemetry-app-token.outputs.token }}
+ github-token: ${{ steps.telemetry-app-token.outputs.token || github.token }}
status-job: 'Playwright tests pass'
runner: 'depot'
diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml
index 193acaab1a83..1f97c36622d6 100644
--- a/.github/workflows/ci-frontend.yml
+++ b/.github/workflows/ci-frontend.yml
@@ -1113,10 +1113,14 @@ jobs:
needs.changes.outputs.frontend_code == 'true' && (
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'PostHog/posthog') ||
(github.event_name != 'pull_request' && github.repository == 'PostHog/posthog')) }}
+ permissions:
+ contents: read
+ actions: read
steps:
- name: Get telemetry app token
id: telemetry-app-token
if: github.run_attempt == '1'
+ continue-on-error: true
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
client-id: ${{ vars.GH_APP_TELEMETRY_APP_ID }}
@@ -1130,7 +1134,7 @@ jobs:
event: 'posthog-ci-running-time'
capture-run-duration: true
capture-job-durations: true
- github-token: ${{ steps.telemetry-app-token.outputs.token }}
+ github-token: ${{ steps.telemetry-app-token.outputs.token || github.token }}
status-job: 'Frontend Tests Pass'
runner: 'github'
- name: Capture running time to DevEx PostHog
@@ -1142,7 +1146,7 @@ jobs:
event: 'posthog-ci-running-time'
capture-run-duration: true
capture-job-durations: true
- github-token: ${{ steps.telemetry-app-token.outputs.token }}
+ github-token: ${{ steps.telemetry-app-token.outputs.token || github.token }}
status-job: 'Frontend Tests Pass'
runner: 'github'
diff --git a/.github/workflows/ci-storybook.yml b/.github/workflows/ci-storybook.yml
index 36feadcaee02..cddba260801d 100644
--- a/.github/workflows/ci-storybook.yml
+++ b/.github/workflows/ci-storybook.yml
@@ -995,10 +995,14 @@ jobs:
needs.changes.outputs.frontend == 'true' && (
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'PostHog/posthog') ||
(github.event_name != 'pull_request' && github.repository == 'PostHog/posthog')) }}
+ permissions:
+ contents: read
+ actions: read
steps:
- name: Get telemetry app token
id: telemetry-app-token
if: github.run_attempt == '1'
+ continue-on-error: true
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
client-id: ${{ vars.GH_APP_TELEMETRY_APP_ID }}
@@ -1012,7 +1016,7 @@ jobs:
event: 'posthog-ci-running-time'
capture-run-duration: true
capture-job-durations: true
- github-token: ${{ steps.telemetry-app-token.outputs.token }}
+ github-token: ${{ steps.telemetry-app-token.outputs.token || github.token }}
status-job: 'Visual regression tests pass'
- name: Capture running time to DevEx PostHog
if: github.run_attempt == '1'
@@ -1023,7 +1027,7 @@ jobs:
event: 'posthog-ci-running-time'
capture-run-duration: true
capture-job-durations: true
- github-token: ${{ steps.telemetry-app-token.outputs.token }}
+ github-token: ${{ steps.telemetry-app-token.outputs.token || github.token }}
status-job: 'Visual regression tests pass'
capture-story-selection: