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): skip non-gating PR bots on trunk-merge branches (#77600)

Georges-Antoine Assie8d0c3f04de2
diff --git a/.github/workflows/auto-assign-labels.yml b/.github/workflows/auto-assign-labels.yml
index 8a26483ec39e..7f71ab0a42d4 100644
--- a/.github/workflows/auto-assign-labels.yml
+++ b/.github/workflows/auto-assign-labels.yml
@@ -32,6 +32,9 @@ concurrency:
jobs:
assign-labels:
+ # Labels derived from the queue's own PR title are discarded with the
+ # branch; the PR being queued was already labeled from its real title.
+ if: ${{ !startsWith(github.head_ref, 'trunk-merge/') }}
runs-on: 'ubuntu-22.04'
timeout-minutes: 5
diff --git a/.github/workflows/docs-preview-trigger.yml b/.github/workflows/docs-preview-trigger.yml
index 3939b115b72b..5612b7e4a0b0 100644
--- a/.github/workflows/docs-preview-trigger.yml
+++ b/.github/workflows/docs-preview-trigger.yml
@@ -15,6 +15,11 @@ permissions:
jobs:
trigger-preview:
+ # The queue's branch is deleted the moment it merges, so its Vercel
+ # preview is torn down before anyone could open it. No gate coverage is
+ # lost either: the frontmatter, internal-docs and link checks below are
+ # all continue-on-error, so they never blocked a merge anyway.
+ if: ${{ !startsWith(github.head_ref, 'trunk-merge/') }}
name: Trigger posthog.com preview build
runs-on: ubuntu-latest
timeout-minutes: 5
diff --git a/.github/workflows/hogbox-preview-env.yml b/.github/workflows/hogbox-preview-env.yml
index d40a9fa6dddc..8eb832fc436b 100644
--- a/.github/workflows/hogbox-preview-env.yml
+++ b/.github/workflows/hogbox-preview-env.yml
@@ -114,6 +114,11 @@ jobs:
# unlabeled-cancel trap: a no-op event runs only this job, never touches the
# `preview`/`teardown` concurrency group, so it can't cancel an active build.
decide:
+ # A preview for the queue's branch would outlive it by minutes, so the
+ # answer is always "do nothing" — skip before spending the API calls.
+ # Downstream jobs key off `needs.decide.outputs.build`, which is empty
+ # when this skips, so they stay skipped too.
+ if: ${{ !startsWith(github.head_ref, 'trunk-merge/') }}
name: '[Optional] decide eligibility'
runs-on: ubuntu-24.04
timeout-minutes: 5
diff --git a/.github/workflows/pr-housekeeping.yml b/.github/workflows/pr-housekeeping.yml
index 828425a4f8e6..767cb57407e3 100644
--- a/.github/workflows/pr-housekeeping.yml
+++ b/.github/workflows/pr-housekeeping.yml
@@ -63,7 +63,9 @@ jobs:
# No synchronize: board status only transitions on reviewer/draft
# changes, and pushes change neither. Re-asserting the same status on
# every push wasted the run and fought manual card moves.
- if: contains(fromJSON('["opened", "reopened", "ready_for_review", "review_requested", "converted_to_draft"]'), github.event.action) && github.event.pull_request.head.repo.full_name == github.repository
+ # No trunk-merge/**: the queue's copy of the PR would add a second,
+ # throwaway card for work the real PR already tracks.
+ if: contains(fromJSON('["opened", "reopened", "ready_for_review", "review_requested", "converted_to_draft"]'), github.event.action) && github.event.pull_request.head.repo.full_name == github.repository && !startsWith(github.head_ref, 'trunk-merge/')
uses: PostHog/.github/.github/workflows/flags-project-board.yml@2db3d3b946aeb9e479ce9f0078139a67f8ef38ce
permissions:
contents: read
@@ -76,7 +78,9 @@ jobs:
PROJECT_BOARD_BOT_PRIVATE_KEY: ${{ secrets.PROJECT_BOARD_BOT_PRIVATE_KEY }}
pr-opened:
- if: contains(fromJSON('["opened", "ready_for_review"]'), github.event.action)
+ # The queue's PR is authored by the Trunk bot, so assigning it and
+ # nudging about the git email has nobody to reach.
+ if: contains(fromJSON('["opened", "ready_for_review"]'), github.event.action) && !startsWith(github.head_ref, 'trunk-merge/')
uses: ./.github/workflows/pr-opened.yml
permissions:
pull-requests: write
diff --git a/.github/workflows/pr-posthog-js-reviewer.yml b/.github/workflows/pr-posthog-js-reviewer.yml
index 9008d3bfe0c4..0af1a0d0c32d 100644
--- a/.github/workflows/pr-posthog-js-reviewer.yml
+++ b/.github/workflows/pr-posthog-js-reviewer.yml
@@ -27,7 +27,10 @@ jobs:
# Skip forks for security - they could manipulate package.json to trigger unwanted reviews.
# Only request reviewers for PRs targeting master. Stacked PR diffs can include package.json
# changes from the stack base and leave stale reviewer requests after the PR is retargeted.
+ # Skip trunk-merge/**: requesting a review on the queue's throwaway PR
+ # pings the client-libraries team for a copy nobody will look at.
if: >-
+ !startsWith(github.head_ref, 'trunk-merge/') &&
github.event.pull_request.head.repo.fork == false &&
github.event.pull_request.base.ref == 'master' &&
(github.event.action != 'edited' || github.event.changes.base.ref.from != '')