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.

chore(ci): run push and schedule ci only in posthog/posthog (#123435)

Georges-Antoine Assi36535e186e06
diff --git a/.github/workflows/ci-agent-proxy.yml b/.github/workflows/ci-agent-proxy.yml
index 7d7f6899f103..0df434aedca6 100644
--- a/.github/workflows/ci-agent-proxy.yml
+++ b/.github/workflows/ci-agent-proxy.yml
@@ -21,6 +21,8 @@ env:
jobs:
changes:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 5
name: Determine need to run agent-proxy checks
diff --git a/.github/workflows/ci-clickhouse-multinode-migrations.yml b/.github/workflows/ci-clickhouse-multinode-migrations.yml
index f70190799e16..187db590ba20 100644
--- a/.github/workflows/ci-clickhouse-multinode-migrations.yml
+++ b/.github/workflows/ci-clickhouse-multinode-migrations.yml
@@ -34,6 +34,8 @@ permissions:
jobs:
multinode-migration-smoke:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
name: Run ClickHouse migrations against per-cluster topology
runs-on: ubuntu-24.04
# The common path primes Postgres from the master schema artifact. The
diff --git a/.github/workflows/ci-dagster.yml b/.github/workflows/ci-dagster.yml
index 8fb51fa13741..1aa966770481 100644
--- a/.github/workflows/ci-dagster.yml
+++ b/.github/workflows/ci-dagster.yml
@@ -74,6 +74,8 @@ jobs:
# actually import — prevents silent drift where a new import slips in
# without a matching filter entry.
validate-paths:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 5
name: Validate dagster path filter coverage
@@ -89,6 +91,8 @@ jobs:
# Job to decide if we should run dagster ci
# See .github/actions/paths-filter/README.md for filter semantics
changes:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 5
name: Determine need to run dagster checks
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index bf6334afcc72..ae58788ded5c 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -109,12 +109,15 @@ jobs:
# Run on master push, manual dispatch, and on ready internal-repo PRs.
# Drafts skip E2E (see the trigger comment); the `Playwright tests pass`
# aggregator treats skipped as success, and drafts can't merge anyway.
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
if: |
+ (github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')) && (
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.head.repo.full_name == github.repository &&
(github.event.pull_request.draft != true ||
startsWith(github.head_ref, 'trunk-merge/')))
+ )
name: Determine need to run E2E checks
outputs:
# Debounce can veto a PR run whose SHA has already been superseded (see below).
diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml
index b01d59dbffb6..4068ed89cd18 100644
--- a/.github/workflows/ci-frontend.yml
+++ b/.github/workflows/ci-frontend.yml
@@ -80,11 +80,14 @@ jobs:
# every other job needs this one, and the gates treat skipped as success.
# The merge queue's trunk-merge/** run is the gate, so skipping a draft
# never weakens what protects master.
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
if: >-
+ (github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')) && (
github.event_name != 'pull_request'
|| github.event.pull_request.draft != true
|| startsWith(github.head_ref, 'trunk-merge/')
|| !contains(github.event.pull_request.labels.*.name, 'no-ci')
+ )
name: Determine need to run frontend checks
# A snapshot-only bot push (Visual Review auto-commits frontend/snapshots.yml after
# approval) skips ci-storybook and ci-e2e-playwright (the snapshot-baseline-dependent
diff --git a/.github/workflows/ci-geoip-canary.yml b/.github/workflows/ci-geoip-canary.yml
index 2d4ddea4e162..a3c19c394bda 100644
--- a/.github/workflows/ci-geoip-canary.yml
+++ b/.github/workflows/ci-geoip-canary.yml
@@ -28,6 +28,8 @@ permissions:
jobs:
canary:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
name: Live GeoLite2 database sanity
runs-on: ubuntu-24.04
timeout-minutes: 15
diff --git a/.github/workflows/ci-hog.yml b/.github/workflows/ci-hog.yml
index c974bd80a71f..c276328a2673 100644
--- a/.github/workflows/ci-hog.yml
+++ b/.github/workflows/ci-hog.yml
@@ -46,6 +46,8 @@ jobs:
# Job to decide if we should run backend ci
# See .github/actions/paths-filter/README.md for filter semantics
changes:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 5
name: Determine need to run Hog checks
diff --git a/.github/workflows/ci-llm-gateway.yml b/.github/workflows/ci-llm-gateway.yml
index 2afe61022996..22b58e93b7d1 100644
--- a/.github/workflows/ci-llm-gateway.yml
+++ b/.github/workflows/ci-llm-gateway.yml
@@ -24,6 +24,8 @@ permissions:
jobs:
changes:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 5
name: Determine need to run LLM Services checks
diff --git a/.github/workflows/ci-mcp-ui-apps.yml b/.github/workflows/ci-mcp-ui-apps.yml
index 74289b2fb57d..8f553a292c80 100644
--- a/.github/workflows/ci-mcp-ui-apps.yml
+++ b/.github/workflows/ci-mcp-ui-apps.yml
@@ -15,6 +15,8 @@ permissions:
jobs:
changes:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 5
name: Determine need to run UI Apps checks
diff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.yml
index 3d0f9b254cee..586dc6f98c1d 100644
--- a/.github/workflows/ci-mcp.yml
+++ b/.github/workflows/ci-mcp.yml
@@ -44,11 +44,14 @@ jobs:
# every other job needs this one, and the gates treat skipped as success.
# The merge queue's trunk-merge/** run is the gate, so skipping a draft
# never weakens what protects master.
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
if: >-
+ (github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')) && (
github.event_name != 'pull_request'
|| github.event.pull_request.draft != true
|| startsWith(github.head_ref, 'trunk-merge/')
|| !contains(github.event.pull_request.labels.*.name, 'no-ci')
+ )
name: Determine need to run MCP checks
outputs:
mcp: ${{ steps.filter.outputs.mcp || 'true' }}
diff --git a/.github/workflows/ci-nodejs.yml b/.github/workflows/ci-nodejs.yml
index 006ed2159f2a..0dbc93e938fc 100644
--- a/.github/workflows/ci-nodejs.yml
+++ b/.github/workflows/ci-nodejs.yml
@@ -56,6 +56,8 @@ jobs:
# Job to decide if we should run nodejs services ci
# See .github/actions/paths-filter/README.md for filter semantics
changes:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 10
name: Determine need to run Node.js checks
diff --git a/.github/workflows/ci-oauth-proxy.yml b/.github/workflows/ci-oauth-proxy.yml
index 5e77fc6ba60f..ed663e355127 100644
--- a/.github/workflows/ci-oauth-proxy.yml
+++ b/.github/workflows/ci-oauth-proxy.yml
@@ -15,6 +15,8 @@ permissions:
jobs:
changes:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 5
name: Determine need to run oauth-proxy checks
diff --git a/.github/workflows/ci-openapi-codegen.yml b/.github/workflows/ci-openapi-codegen.yml
index 3fbe6f88d3aa..65c8c03272d3 100644
--- a/.github/workflows/ci-openapi-codegen.yml
+++ b/.github/workflows/ci-openapi-codegen.yml
@@ -18,6 +18,8 @@ permissions:
jobs:
test:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
name: OpenAPI codegen tests
runs-on: ubuntu-24.04
timeout-minutes: 5
diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml
index a4451931c67d..5ad9b4a27f8a 100644
--- a/.github/workflows/ci-python.yml
+++ b/.github/workflows/ci-python.yml
@@ -50,6 +50,8 @@ jobs:
# Job to decide if we should run python ci
# See .github/actions/paths-filter/README.md for filter semantics
changes:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
runs-on: ubuntu-24.04
timeout-minutes: 5
name: Determine need to run python checks
diff --git a/.github/workflows/ci-rust-flags-integration.yml b/.github/workflows/ci-rust-flags-integration.yml
index c1cb19ca48e4..bd2235041d52 100644
--- a/.github/workflows/ci-rust-flags-integration.yml
+++ b/.github/workflows/ci-rust-flags-integration.yml
@@ -53,6 +53,8 @@ env:
jobs:
rust-flags-integration:
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')
name: Rust /flags Integration Tests (depot-ubuntu-24.04)
runs-on: depot-ubuntu-24.04
timeout-minutes: 30
diff --git a/.github/workflows/ci-security.yaml b/.github/workflows/ci-security.yaml
index 55d92144dc8b..fa15071100b3 100644
--- a/.github/workflows/ci-security.yaml
+++ b/.github/workflows/ci-security.yaml
@@ -20,7 +20,8 @@ jobs:
changes:
runs-on: ubuntu-24.04
timeout-minutes: 5
- if: github.repository_owner == 'PostHog'
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
+ if: (github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')) && (github.repository_owner == 'PostHog')
name: Determine need to run Semgrep checks
permissions:
contents: read
@@ -613,10 +614,14 @@ jobs:
steps:
- name: Check matrix outcome
run: |
- if [[ "${{ needs.changes.result }}" != "success" ]]; then
+ if [[ "${{ needs.changes.result }}" != "success" && "${{ needs.changes.result }}" != "skipped" ]]; then
echo "changes (path filter) job did not succeed - cannot trust skips."
exit 1
fi
+ if [[ "${{ needs.changes.result }}" == "skipped" && "${{ github.repository != 'PostHog/posthog' && (github.event_name == 'push' || github.event_name == 'schedule') }}" != "true" ]]; then
+ echo "changes (path filter) job was skipped - cannot trust skips."
+ exit 1
+ fi
if [[ "${{ needs.semgrep-python.result }}" != "success" && "${{ needs.semgrep-python.result }}" != "skipped" ]]; then
echo "semgrep-python did not complete successfully."
exit 1
diff --git a/.github/workflows/ci-storybook.yml b/.github/workflows/ci-storybook.yml
index be0a2e22d799..ad405d9dcf49 100644
--- a/.github/workflows/ci-storybook.yml
+++ b/.github/workflows/ci-storybook.yml
@@ -71,11 +71,14 @@ jobs:
# A draft PR labeled `no-ci` skips this workflow entirely (prototypes):
# every other job needs this one, and the gates treat skipped as success.
# ready_for_review re-runs everything, so the merge gate is unaffected.
+ # Push and schedule runs only belong in this repo. Mirrors run CI on their own PRs only.
if: >-
+ (github.repository == 'PostHog/posthog' || (github.event_name != 'push' && github.event_name != 'schedule')) && (
github.event_name != 'pull_request'
|| github.event.pull_request.draft != true
|| startsWith(github.head_ref, 'trunk-merge/')
|| !contains(github.event.pull_request.labels.*.name, 'no-ci')
+ )
name: Determine need to run storybook checks
# Set job outputs to values from filter step
outputs: