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 safe unrelated agent proxy pushes (#127765)

posthog[bot]e2007fce46c7
diff --git a/.github/workflows/ci-agent-proxy.yml b/.github/workflows/ci-agent-proxy.yml
index cf4558fe229d..19bc77b945ee 100644
--- a/.github/workflows/ci-agent-proxy.yml
+++ b/.github/workflows/ci-agent-proxy.yml
@@ -20,14 +20,48 @@ env:
NPM_CONFIG_FUND: 'false'
jobs:
+ push-baseline:
+ if: github.repository == 'PostHog/posthog' && github.event_name == 'push'
+ permissions:
+ actions: read
+ runs-on: ubuntu-24.04
+ timeout-minutes: 5
+ outputs:
+ safe: ${{ steps.baseline.outcome == 'success' && steps.baseline.outputs.result == 'true' }}
+ steps:
+ - name: Check push baseline
+ id: baseline
+ continue-on-error: true
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ with:
+ script: |
+ const before = context.payload.before;
+ if (!/^[0-9a-f]{40}$/.test(before || '') || /^0+$/.test(before)) {
+ core.info('Full checks: no valid push baseline.');
+ return false;
+ }
+ const { data } = await github.rest.actions.listWorkflowRuns({
+ ...context.repo,
+ workflow_id: 'ci-agent-proxy.yml',
+ branch: 'master',
+ event: 'push',
+ head_sha: before,
+ per_page: 1,
+ });
+ const previous = data.workflow_runs[0];
+ const safe = previous?.head_sha === before && previous?.conclusion === 'success';
+ core.info(safe ? 'Compare the complete push range.' : 'Full checks: push baseline is not green.');
+ return safe;
+
changes:
+ needs: push-baseline
# 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')
+ if: ${{ !cancelled() && (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
outputs:
- agent_proxy: ${{ steps.filter.outputs.agent_proxy || 'true' }}
+ agent_proxy: ${{ steps.filter.outcome == 'success' && steps.filter.outputs.agent_proxy || 'true' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
@@ -40,21 +74,38 @@ jobs:
with:
client-id: ${{ vars.GH_APP_POSTHOG_PATHS_FILTER_APP_ID }}
private-key: ${{ secrets.GH_APP_POSTHOG_PATHS_FILTER_PRIVATE_KEY }}
+ - name: Fetch push baseline without blobs
+ id: fetch-baseline
+ if: needs.push-baseline.outputs.safe == 'true'
+ continue-on-error: true
+ env:
+ PUSH_BEFORE: ${{ github.event.before }}
+ run: git fetch --no-tags --depth=1 --filter=blob:none origin "$PUSH_BEFORE"
+
- uses: ./.github/actions/paths-filter
id: filter
- if: github.event_name != 'push'
+ if: github.event_name == 'pull_request' || steps.fetch-baseline.outcome == 'success'
+ continue-on-error: ${{ github.event_name == 'push' }}
with:
token: ${{ steps.app-token.outputs.token || github.token }}
+ base: ${{ github.event.before }}
+ ref: ${{ github.sha }}
filters: |
agent_proxy:
+ - '*'
- 'services/agent-proxy/**'
- 'ee/hogai/sandbox/turn_event_contract.json'
+ - '.github/actions/paths-filter/**'
+ - '.github/actions/pnpm-install/**'
+ - '.github/actions/setup-pnpm/**'
+ - 'patches/**'
+ - 'bin/fix-rdkafka-paths'
- '.github/workflows/ci-agent-proxy.yml'
agent-proxy:
name: Agent Proxy checks
needs: changes
- if: needs.changes.outputs.agent_proxy == 'true'
+ if: ${{ !cancelled() && needs.changes.outputs.agent_proxy == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
steps: