: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(ci): move remaining setup-node/python API calls off GITHUB_TOKEN (#75068)
Raúl Negrón-Otero7b6acdae57cc
diff --git a/.depot/workflows/ci-backend.yml b/.depot/workflows/ci-backend.ymlindex 059700453ef7..f1e3e2165638 100644--- a/.depot/workflows/ci-backend.yml+++ b/.depot/workflows/ci-backend.yml@@ -516,6 +516,8 @@ jobs:MIG_HASH=$(printf '%s\n%s' "$MIG_FILES" "$PG_IMAGE" | sha256sum | cut -c1-40)echo "migrations_key=posthog-schema-mig-${SCHEMA_CACHE_EPOCH}-${MIG_HASH}" >> $GITHUB_OUTPUTfi+ # Shadow trial: canonical threads a setup-action app token into+ # pnpm-install; mint stripped here (secret not available on Depot).- name: Install pnpm dependenciesuses: ./.depot/actions/pnpm-installwith:@@ -819,6 +821,8 @@ jobs:db redis7 clickhouse zookeeper kafka objectstorage \temporal elasticsearch objectstorage-azure \</dev/null >"${RUNNER_TEMP:-/tmp}/compose-launch.log" 2>&1+ # Shadow trial: canonical threads a setup-action app token into+ # pnpm-install; mint stripped here (secret not available on Depot).- name: Install pnpm dependenciesuses: ./.depot/actions/pnpm-installwith:diff --git a/.github/actions/pnpm-install/action.yml b/.github/actions/pnpm-install/action.ymlindex fb5981118f1d..0f2e2090384b 100644--- a/.github/actions/pnpm-install/action.yml+++ b/.github/actions/pnpm-install/action.yml@@ -25,6 +25,13 @@ inputs:description: 'Directory to run the install command in.'required: falsedefault: '.'+ token:+ description: |+ GitHub token for setup-node's version-manifest lookup and Node download.+ Pass an app token at high-fanout call sites to keep those API calls off+ the shared per-repo GITHUB_TOKEN core bucket.+ required: false+ default: ${{ github.token }}runs:using: composite@@ -40,7 +47,7 @@ runs:uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: ${{ inputs.node-version-file }}- token: ${{ github.token }}+ token: ${{ inputs.token }}- name: Get pnpm store pathid: pnpm-storediff --git a/.github/workflows/ci-agent-skills.yml b/.github/workflows/ci-agent-skills.ymlindex cb0d1fdaaab5..2f8dd3d0081e 100644--- a/.github/workflows/ci-agent-skills.yml+++ b/.github/workflows/ci-agent-skills.yml@@ -81,11 +81,21 @@ jobs:run: |bin/ci-wait-for-docker launch --down+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version-file: 'pyproject.toml'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvuses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0@@ -198,11 +208,21 @@ jobs:run: |bin/ci-wait-for-docker launch --down+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version-file: 'pyproject.toml'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvuses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.ymlindex 8f58b6664b69..a7a1af320360 100644--- a/.github/workflows/ci-backend.yml+++ b/.github/workflows/ci-backend.yml@@ -438,6 +438,7 @@ jobs:uses: ./.github/actions/pnpm-installwith:install-command: pnpm install --frozen-lockfile --filter=@posthog/root+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Restore test durations from cache# Shard counts are derived from .test_durations (Amdahl). Restore the newest@@ -806,20 +807,23 @@ jobs:db redis7 clickhouse zookeeper kafka objectstorage \temporal elasticsearch objectstorage-azure+ # Dedicated app: this product matrix alone is ~half the offloadable+ # setup-action volume, enough to threaten any shared 15k/hr bucket.- name: Mint setup-action GitHub tokenid: setup-gh-tokenif: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repositorycontinue-on-error: trueuses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1with:- client-id: ${{ secrets.GH_APP_POSTHOG_DEVEX_GENERAL_APP_ID }}- private-key: ${{ secrets.GH_APP_POSTHOG_DEVEX_GENERAL_PRIVATE_KEY }}+ client-id: ${{ secrets.GH_APP_POSTHOG_PRODUCT_TESTS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_PRODUCT_TESTS_PRIVATE_KEY }}skip-token-revoke: true- name: Install pnpm dependenciesuses: ./.github/actions/pnpm-installwith:install-command: pnpm install --frozen-lockfile --filter=@posthog/root+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0diff --git a/.github/workflows/ci-dagster.yml b/.github/workflows/ci-dagster.ymlindex 0e8c7dfdf14d..79fed9af5951 100644--- a/.github/workflows/ci-dagster.yml+++ b/.github/workflows/ci-dagster.yml@@ -308,11 +308,21 @@ jobs:CLICKHOUSE_SERVER_IMAGE: ${{ matrix.clickhouse-server-image }}run: bin/ci-wait-for-docker wait+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version-file: 'pyproject.toml'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvid: setup-uvdiff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.ymlindex 623e05cdc758..053f0a395d22 100644--- a/.github/workflows/ci-e2e-playwright.yml+++ b/.github/workflows/ci-e2e-playwright.yml@@ -542,11 +542,21 @@ jobs:shell: bashrun: echo "127.0.0.1 db redis7 kafka clickhouse clickhouse-coordinator objectstorage seaweedfs temporal" | sudo tee -a /etc/hosts+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version: 3.13.13- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvid: setup-uv@@ -581,7 +591,7 @@ jobs:uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}# This job checks out the PR head (not the merge ref), so it can't use# the ./.github/actions/pnpm-install local action — an un-rebased head@@ -1164,11 +1174,21 @@ jobs:playwright/snapshots.ymlsparse-checkout-cone-mode: false+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Node.jsuses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install VR CLIrun: cd products/visual_review/cli && npm ci && npm run build && npm linkdiff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.ymlindex 6652da253140..10824cfe0b9a 100644--- a/.github/workflows/ci-frontend.yml+++ b/.github/workflows/ci-frontend.yml@@ -365,11 +365,21 @@ jobs:- name: Fix node-gyp permissionsrun: find ~/setup-pnpm -name gyp_main.py -exec chmod +x {} ++ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Node.jsuses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Get pnpm store pathid: pnpm-store@@ -684,10 +694,21 @@ jobs:if: matrix.segment == 'FOSS'run: rm -rf ee+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Install pnpm dependenciesuses: ./.github/actions/pnpm-installwith:install-command: pnpm --filter=@posthog/frontend... install --frozen-lockfile+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Test with Jestid: run-jestdiff --git a/.github/workflows/ci-hog.yml b/.github/workflows/ci-hog.ymlindex 924e3fff5a17..2dafe863fc52 100644--- a/.github/workflows/ci-hog.yml+++ b/.github/workflows/ci-hog.yml@@ -73,11 +73,21 @@ jobs:with:fetch-depth: 1+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version-file: 'pyproject.toml'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvid: setup-uv@@ -102,6 +112,7 @@ jobs:uses: ./.github/actions/pnpm-installwith:install-command: pnpm --filter=@posthog/hogvm install --frozen-lockfile+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Check if ANTLR definitions are up to daterun: |@@ -174,11 +185,20 @@ jobs:uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2with:fetch-depth: 1+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version-file: 'pyproject.toml'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvid: setup-uv-hogql-pythonuses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0@@ -204,7 +224,7 @@ jobs:with:node-version-file: .nvmrcregistry-url: https://registry.npmjs.org- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install package.json dependenciesrun: pnpm --filter=@posthog/hogvm install --frozen-lockfile- name: Publish the package in the npm registrydiff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.ymlindex 31e2a8c1bdce..d0e36bd92337 100644--- a/.github/workflows/ci-mcp.yml+++ b/.github/workflows/ci-mcp.yml@@ -142,11 +142,21 @@ jobs:- name: Checkout codeuses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version: 3.13.13- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvuses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0@@ -163,6 +173,7 @@ jobs:uses: ./.github/actions/pnpm-installwith:install-command: pnpm --filter=@posthog/root --filter=@posthog/mcp... --filter='./products/*' install --frozen-lockfile+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Check MCP code qualityrun: |@@ -335,11 +346,21 @@ jobs:shell: bashrun: echo "127.0.0.1 db redis7 kafka clickhouse clickhouse-coordinator objectstorage seaweedfs temporal" | sudo tee -a /etc/hosts+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version: 3.13.13- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvuses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0@@ -363,6 +384,7 @@ jobs:uses: ./.github/actions/pnpm-installwith:install-command: pnpm --filter=@posthog/mcp... --filter='./products/*' install --frozen-lockfile+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Set up needed filesshell: bashdiff --git a/.github/workflows/ci-nodejs.yml b/.github/workflows/ci-nodejs.ymlindex 716372305767..ee4e1625cf95 100644--- a/.github/workflows/ci-nodejs.yml+++ b/.github/workflows/ci-nodejs.yml@@ -292,11 +292,21 @@ jobs:- name: Add service hostnames to /etc/hostsrun: echo "127.0.0.1 db redis7 kafka clickhouse clickhouse-coordinator objectstorage seaweedfs temporal" | sudo tee -a /etc/hosts+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version-file: 'pyproject.toml'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvid: setup-uv@@ -347,6 +357,7 @@ jobs:uses: ./.github/actions/pnpm-installwith:install-command: pnpm --filter=@posthog/nodejs... install --frozen-lockfile+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Wait for Clickhouse, Redis, Kafka, Localstack, SeaweedFS# seaweedfs backs the blob-store integration tests; the profile-scoped@@ -556,11 +567,21 @@ jobs:- name: Add service hostnames to /etc/hostsrun: echo "127.0.0.1 db redis7 kafka clickhouse clickhouse-coordinator objectstorage seaweedfs temporal" | sudo tee -a /etc/hosts+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version-file: 'pyproject.toml'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvid: setup-uv@@ -611,6 +632,7 @@ jobs:uses: ./.github/actions/pnpm-installwith:install-command: pnpm --filter=@posthog/nodejs... install --frozen-lockfile+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Wait for Clickhouse, Redis, Kafka, Localstackrun: docker compose -f docker-compose.dev.yml up kafka redis7 clickhouse maildev localstack -d --waitdiff --git a/.github/workflows/ci-proto.yml b/.github/workflows/ci-proto.ymlindex b5f80833f89c..c6e636dd78e5 100644--- a/.github/workflows/ci-proto.yml+++ b/.github/workflows/ci-proto.yml@@ -97,10 +97,20 @@ jobs:with:clean: false+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version: '3.13.13'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install codegen toolsrun: pip install grpcio-tools protoletariat ruffdiff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.ymlindex be85395cf7af..79779f25adb3 100644--- a/.github/workflows/ci-python.yml+++ b/.github/workflows/ci-python.yml@@ -88,11 +88,21 @@ jobs:with:fetch-depth: 1+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version: 3.13.13- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvid: setup-uvdiff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.ymlindex 0de4e371679f..607233d82a2d 100644--- a/.github/workflows/ci-rust.yml+++ b/.github/workflows/ci-rust.yml@@ -363,11 +363,21 @@ jobs:- name: Install sccacheuses: ./.github/actions/setup-sccache+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Pythonuses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0with:python-version-file: 'pyproject.toml'- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install uvid: setup-uvdiff --git a/.github/workflows/ci-security.yaml b/.github/workflows/ci-security.yamlindex 6f3e9f0cc4ac..7e195dcfb475 100644--- a/.github/workflows/ci-security.yaml+++ b/.github/workflows/ci-security.yaml@@ -41,10 +41,18 @@ jobs:id: oversizedif: github.event_name == 'pull_request' && github.event.pull_request.changed_files > 3000run: echo "force_all=true" >> "$GITHUB_OUTPUT"+ - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ id: app-token+ # forks can't read org secrets — fall back to github.token+ if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_PATHS_FILTER_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_PATHS_FILTER_PRIVATE_KEY }}- uses: ./.github/actions/paths-filterid: filterif: github.event_name != 'push' && steps.oversized.outputs.force_all != 'true'with:+ token: ${{ steps.app-token.outputs.token || github.token }}filters: |python:- 'bin/**'diff --git a/.github/workflows/ci-storybook.yml b/.github/workflows/ci-storybook.ymlindex a20c157e6a1d..87d33b59794f 100644--- a/.github/workflows/ci-storybook.yml+++ b/.github/workflows/ci-storybook.yml@@ -194,6 +194,16 @@ jobs:- name: Fix node-gyp permissionsrun: find ~/setup-pnpm -name gyp_main.py -exec chmod +x {} ++ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+# This job checks out the PR head (not the merge ref), so it can't use# the ./.github/actions/pnpm-install local action — an un-rebased head# may not contain it. Cache the store inline instead, sharing the same@@ -202,7 +212,7 @@ jobs:uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Get pnpm store pathid: pnpm-store@@ -314,11 +324,21 @@ jobs:products/visual_review/frontend/generated/api.schemas.tssparse-checkout-cone-mode: false+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Node.jsuses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install VR CLIrun: cd vr-cli/products/visual_review/cli && npm ci && npm run build@@ -391,11 +411,21 @@ jobs:- name: Fix node-gyp permissionsrun: find ~/setup-pnpm -name gyp_main.py -exec chmod +x {} ++ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Node.jsuses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Get pnpm store pathid: pnpm-store@@ -564,11 +594,21 @@ jobs:- name: Fix node-gyp permissionsrun: find ~/setup-pnpm -name gyp_main.py -exec chmod +x {} ++ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Node.jsuses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Get pnpm store pathid: pnpm-store@@ -702,11 +742,21 @@ jobs:products/visual_review/frontend/generated/api.schemas.tssparse-checkout-cone-mode: false+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- name: Set up Node.jsuses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Install VR CLIrun: cd vr-cli/products/visual_review/cli && npm ci && npm run build@@ -841,10 +891,20 @@ jobs:ref: ${{ github.event.pull_request.head.sha }}repository: ${{ github.event.pull_request.head.repo.full_name }}+ - name: Mint setup-action GitHub token+ id: setup-gh-token+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ skip-token-revoke: true+- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0with:node-version-file: .nvmrc- token: ${{ github.token }}+ token: ${{ steps.setup-gh-token.outputs.token || github.token }}- name: Download module-graph artifactid: downloaddiff --git a/.github/workflows/monitor-github-rate-limit.yml b/.github/workflows/monitor-github-rate-limit.ymlindex 4347d62c2365..2c886f365c47 100644--- a/.github/workflows/monitor-github-rate-limit.yml+++ b/.github/workflows/monitor-github-rate-limit.yml@@ -47,6 +47,14 @@ on:required: falseGH_APP_TELEMETRY_PRIVATE_KEY:required: false+ GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID:+ required: false+ GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY:+ required: false+ GH_APP_POSTHOG_PRODUCT_TESTS_APP_ID:+ required: false+ GH_APP_POSTHOG_PRODUCT_TESTS_PRIVATE_KEY:+ required: falsepush:branches: [master]schedule:@@ -79,12 +87,13 @@ jobs:const script = require('./.github/scripts/monitor-github-rate-limit.js')await script({ github, context, core }, { source: 'github_token' })- # The setup-action offload bucket (posthog-devex-general) is a- # separate 15k installation bucket from GITHUB_TOKEN. Mint its token- # and poll /rate_limit through it so its core budget is observable as- # its own series. /rate_limit reads don't consume the budget they- # report, so this doesn't distort the measurement. No-ops until the- # org secret exists (continue-on-error mint + empty-token guard).+ # The setup-action offload buckets are their own 15k/hr installation+ # buckets, separate from the per-repo GITHUB_TOKEN core bucket+ # (30k/hr). Mint each token and poll /rate_limit through it so its+ # core budget is observable as its own series. /rate_limit reads+ # don't consume the budget they report, so this doesn't distort the+ # measurement. No-ops until the org secret exists (continue-on-error+ # mint + empty-token guard).- name: Mint posthog-devex-general tokenid: devex-tokencontinue-on-error: true@@ -164,3 +173,45 @@ jobs:script: |const script = require('./.github/scripts/monitor-github-rate-limit.js')await script({ github, context, core }, { source: 'posthog-telemetry' })++ # posthog-setup-actions carries the highest-fanout setup-node/python+ # sites (backend product matrix, storybook, frontend, nodejs, mcp).+ - name: Mint posthog-setup-actions token+ id: setup-actions-token+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}++ - name: Poll posthog-setup-actions bucket and emit to PostHog+ if: steps.setup-actions-token.outputs.token != ''+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0+ env:+ POSTHOG_DEVEX_PROJECT_API_TOKEN: ${{ secrets.POSTHOG_DEVEX_PROJECT_API_TOKEN }}+ with:+ github-token: ${{ steps.setup-actions-token.outputs.token }}+ script: |+ const script = require('./.github/scripts/monitor-github-rate-limit.js')+ await script({ github, context, core }, { source: 'posthog-setup-actions' })++ # posthog-product-tests carries only ci-backend's product-test matrix,+ # ~half the offloadable setup-action volume on its own.+ - name: Mint posthog-product-tests token+ id: product-tests-token+ continue-on-error: true+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1+ with:+ client-id: ${{ secrets.GH_APP_POSTHOG_PRODUCT_TESTS_APP_ID }}+ private-key: ${{ secrets.GH_APP_POSTHOG_PRODUCT_TESTS_PRIVATE_KEY }}++ - name: Poll posthog-product-tests bucket and emit to PostHog+ if: steps.product-tests-token.outputs.token != ''+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0+ env:+ POSTHOG_DEVEX_PROJECT_API_TOKEN: ${{ secrets.POSTHOG_DEVEX_PROJECT_API_TOKEN }}+ with:+ github-token: ${{ steps.product-tests-token.outputs.token }}+ script: |+ const script = require('./.github/scripts/monitor-github-rate-limit.js')+ await script({ github, context, core }, { source: 'posthog-product-tests' })diff --git a/.github/workflows/pr-housekeeping.yml b/.github/workflows/pr-housekeeping.ymlindex c72abacb4133..cf0a8be0ff6a 100644--- a/.github/workflows/pr-housekeeping.yml+++ b/.github/workflows/pr-housekeeping.yml@@ -54,6 +54,10 @@ jobs:GH_APP_POSTHOG_PATHS_FILTER_PRIVATE_KEY: ${{ secrets.GH_APP_POSTHOG_PATHS_FILTER_PRIVATE_KEY }}GH_APP_TELEMETRY_APP_ID: ${{ secrets.GH_APP_TELEMETRY_APP_ID }}GH_APP_TELEMETRY_PRIVATE_KEY: ${{ secrets.GH_APP_TELEMETRY_PRIVATE_KEY }}+ GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_APP_ID }}+ GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY: ${{ secrets.GH_APP_POSTHOG_SETUP_ACTIONS_PRIVATE_KEY }}+ GH_APP_POSTHOG_PRODUCT_TESTS_APP_ID: ${{ secrets.GH_APP_POSTHOG_PRODUCT_TESTS_APP_ID }}+ GH_APP_POSTHOG_PRODUCT_TESTS_PRIVATE_KEY: ${{ secrets.GH_APP_POSTHOG_PRODUCT_TESTS_PRIVATE_KEY }}flags-project-board:# No synchronize: board status only transitions on reviewer/draft