Skip to content

[build-tools] Add eas/posthog_capture_event workflow function#3934

Draft
gwdp wants to merge 1 commit into
mainfrom
gwdp/eng-21551-posthog-capture-event
Draft

[build-tools] Add eas/posthog_capture_event workflow function#3934
gwdp wants to merge 1 commit into
mainfrom
gwdp/eng-21551-posthog-capture-event

Conversation

@gwdp

@gwdp gwdp commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Why

First PostHog workflow step: send an event from a workflow (e.g. mark a deploy).

How

add eas/posthog_capture_event function; Uses the env vars integrations:posthog:connect already sets, or api_key/host inputs.

No distinct_id = anonymous event, so CI runs don't create person profiles. Failures fail the step; set ignore_error: true to log a warning and continue instead (same as upload_artifact).

Test Plan

CI passes. Ran this workflow against a local — all three jobs green, both events visible in the project's PostHog activity (anonymous one under the eas-workflow person), and the ignored failure logs a warning without failing the step:

name: PostHog capture test

jobs:
  anonymous_event:
    steps:
      - uses: eas/posthog_capture_event
        with:
          event: eas_workflow_test
          properties:
            source: coin-flip-workflow-test

  identified_event:
    steps:
      - uses: eas/posthog_capture_event
        with:
          event: eas_workflow_test_identified
          distinct_id: gwdp-local-test
          properties:
            source: coin-flip-workflow-test
            variant: identified

  ignored_failure:
    steps:
      - uses: eas/posthog_capture_event
        with:
          event: eas_workflow_test_ignored
          host: https://example.com
          ignore_error: true

Workflow succeeds

Screenshot 2026-07-02 at 4 51 42 PM

Data appears on my posthog organization

Screenshot 2026-07-02 at 4 52 57 PM

@linear-code

linear-code Bot commented Jul 2, 2026

Copy link
Copy Markdown

ENG-21551

@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-capture-event branch from cd23f3a to 5ce0514 Compare July 2, 2026 18:32
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.33%. Comparing base (9247f3c) to head (0d8006c).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3934      +/-   ##
==========================================
+ Coverage   59.18%   59.33%   +0.15%     
==========================================
  Files         935      937       +2     
  Lines       41075    41144      +69     
  Branches     8648     8671      +23     
==========================================
+ Hits        24306    24407     +101     
+ Misses      16674    16643      -31     
+ Partials       95       94       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-capture-event branch 7 times, most recently from c620ee0 to c08213f Compare July 3, 2026 06:48
@gwdp gwdp force-pushed the gwdp/eng-21551-posthog-capture-event branch from c08213f to 0d8006c Compare July 3, 2026 07:35
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant