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.

19.0 KB
Raw Blame

Depot CI check runs, and how GitHub scores them

PostHog-authored. Not part of the vendored upstream skill.

Two engines report on the same commit in this repo, and they are easy to confuse:

  • Depot runners run GitHub Actions jobs from .github/workflows/. GitHub is still the engine, and checks come from the github-actions app. See the depot-github-runners skill.
  • Depot CI is its own engine. It parses workflows under .depot/workflows/, which GitHub Actions ignores, and reports its own check runs from one of three Depot apps (see Which app posts a Depot check). That is what this skill covers.

Neither vendor documents any of what follows. It comes from running one job graph on both engines against the same commit and reading the check runs each posted. To re-derive it, put twin workflows in .github/workflows/ and .depot/workflows/, give each job a shape from the table below, and have an if: always() job print toJSON(needs).

Conclusions the two engines post

Job shape GHA needs.result GHA check run Depot needs.result Depot check run
Plain success success success success success
if: false skipped skipped skipped skipped
if: expression that is false skipped skipped skipped skipped
Skipped because a dependency skipped skipped skipped skipped skipped
Matrix that expands to zero cells failure none posted skipped skipped
Two cell matrix success two checks, (1) and (2) success one check per cell
Job-level continue-on-error, step fails success failure success failure
Step-level continue-on-error, step fails success success success success
Hard failure failure failure failure failure
if: always() gate over all of the above success success success success

The engines agree everywhere except the empty matrix.

Two cases where the check disagrees with the run

A job-level continue-on-error: true still posts a failure check run. Dependents read success, the workflow goes green, and the check stays red. Put a required context on such a job and the merge blocks while every gate says the run passed. Prefer step-level continue-on-error plus an explicit verdict step, which is what ci-backend.yml does.

An empty matrix is a failure on GitHub Actions, not a skip. The job posts no check run at all, so the checks list shows nothing wrong, while every dependent reads failure. Depot CI calls the same job skipped and posts a check for it. Any job whose matrix comes from fromJSON of a computed value needs an if: guard that skips it when the list is empty, or the two engines disagree about whether the run passed.

How GitHub scores a conclusion against a required context

  • A check run that concludes skipped satisfies a required status check, and the Trunk merge queue scores it the same way. The repo already depends on this: Build Docker image is a required context that concludes skipped on most PRs, and they merge.

  • A required context that no check run ever reports stays pending and blocks. This is the empty-matrix failure mode above, and it is also what a paths: filter does when it silences a whole workflow.

  • A check run that stays in_progress blocks, and GitHub keeps every completed check run on its commit. Depot creates a job's own check only when the job resolves, so a new run on an already green commit (a draft marked ready, a reopen) cannot hold the commit pending: the old success stands until the new gate job ends. That is why the required backend context is the gate job's Backend CI on Depot / Test results check, posted by the PostHog tests app: a passing draft run does not post it, so the context stays missing until the ready run posts the verdict. A draft shows the check only when its run failed.

  • A ruleset entry with an integration_id accepts a check from that one app only. An entry without one accepts a check from any app, which GitHub's UI calls "Any source". Most entries in this repo's master ruleset carry integration_id: 15368, the github-actions app. Backend CI on Depot / Test results carries 2492437, the tests-posthog app. Backend CI on Depot / Django Tests Pass on Depot carries none. Read them with:

    gh api repos/PostHog/posthog/rulesets --jq '.[] | select(.name=="master") | .id'
    gh api repos/PostHog/posthog/rulesets/<id> \
        --jq '.rules[] | select(.type=="required_status_checks") | .parameters.required_status_checks'
    

    A check run from any other app does not satisfy a context pinned to github-actions, even when the name matches exactly.

  • Trunk merge queue takes its required list from GitHub branch protection by default, and can override it from the Trunk UI or from merge.required_statuses in .trunk/trunk.yaml. The trunk.yaml form matches on name only, with no app pinning, so a repo that sets both can have Trunk and GitHub disagree about which app's check counts. This repo sets no merge: block, so branch protection is the source.

Which app posts a Depot check

Depot's GitHub checks page says a check can come from any of these apps, with the same name:

App Slug App id
Depot Checks depot-checks 4964980
Depot Checks 2 depot-checks-2 4968192
Depot Code Access depot-code-access 219785

Depot uses the Depot Checks apps first and falls back to Depot Code Access. A check stays with the app that created it.

A required context for a check that Depot posts must use "Any source", as Depot's GitHub checks page says. Match a Depot check by its name, or by its details_url, which holds the Depot workflow ID. Never match it by one app ID. GitHub's GraphQL checkSuites takes filterBy: {checkName}, which matches a suite from any app.

A check that a Depot job posts itself through the REST API comes from the app whose token the step used, so its required context can stay pinned to that app. Backend CI on Depot / Test results is one.

Naming

Depot names each check <workflow name> / <job name>. GitHub Actions names it <job name> alone. The workflow name is therefore part of every Depot context, and renaming a workflow renames every check it posts.

Both engines post one check per matrix cell. Depot also posts an internal expansion check named <file>:<job key> for a matrix built from fromJSON, for example Backend CI on Depot / ci-backend.yml:django, which concludes skipped.

When a check run appears

Depot creates a job's check run when it resolves the job, not when it creates the run: a job that starts gets its check in the same second as Depot's own started_at for the job, and a job that is skipped gets a skipped check when its dependencies settle. A job behind a long dependency chain therefore has no check run at all until it starts. Measured 2026-09-17 on three runs of Backend CI on Depot (for example run bbtwxmr3b5): the first job's check appeared 53 to 65 seconds after the run was created, and the gate job's check appeared 21 minutes later, when the matrix finished. GitHub Actions differs: it posts every job's check as queued when the run is created. A poller that treats "no check run yet" as "the run does not exist" is wrong on Depot; poll the first job in the needs graph to learn whether Depot picked the event up, and the gate to learn the verdict.

Reruns

GitHub's Re-run button on a Depot check does nothing. GitHub's checks guide says the request goes to the GitHub App that created the check run, and Depot's app does not act on it: measured 2026-10-16, GitHub reported the rerun as requested and Depot started no attempt. A /depot retry comment on the pull request starts the retry instead. .github/workflows/depot-retry-on-comment.yml runs depot ci retry --failed on the pull request's newest run. It runs on GitHub Actions because Depot CI records a run for every comment that reaches an issue_comment workflow. A job if: that is false still leaves a run with a skipped job, and Depot ignores a workflow-level if:. Measured 2026-10-21 with push-triggered probe workflows in run ps_01p74dcdmm, because a comment trigger runs only from the default branch. That command works while other jobs of the workflow still run, and it reruns the jobs downstream of each retried job, so the gate reads the new attempt.

Retrying a failed Depot job created a new check run with the same name and left the failed one behind in the measured 2026-09-17 run jb7zh5rvnk: the retried cell got check run 105270302262 while 105262890457 stayed completed/failure; only filter=all on the check-runs API listed both. GitHub Actions does the same per attempt, which is why a superseded run can show a stale red check beside a green one of the same name. Read the latest check run per name when you script against either engine: the API's default filter=latest returns only the newest, and max_by(.id) does the same on a full listing. Two details matter when the read decides something: a GitHub Actions rerun queues a fresh check run for every job before any of them runs, so a script that wants the last verdict filters on status == "completed" before it takes the newest; and the check-runs API lists every pull request's checks for a head SHA, so a script that acts for one pull request filters on pull_requests[].number when it is present.

Depot's list can still be empty. The check suites API says a suite is created when code is pushed and an app usually receives one suite event per commit SHA even if that SHA is pushed to multiple branches. On commit f786b640f2f0, Depot's suite 97293642167 names a posthog/rewrite-tmp/ branch and has pull_requests: [], while GitHub Actions suites on the same commit name PR 104868's branch and list that PR. Commit 749f24dd5b7a shows the same split with a -rebase-1 branch. This is consistent with the suite retaining an earlier push branch, but the suite records do not establish push order. Filtering those Depot checks by pull_requests[].number finds no check for the PR.

Cancelled runs

In the following cancelled runs, an unstarted job received a cancelled check with started_at and completed_at set to the cancel time. A started_at >= event time filter kept the superseded run's check, which could be the newest one of its name. Measured 2026-09-24:

  • Depot: gate check 107582798883 of cancelled workflow x17bxd5m0z started and completed at 09:55:14, 54 seconds after the next event and before that event's gate appeared.
  • GitHub Actions: hand-off check 107604825793 of cancelled run 35990511352 started and completed at 11:05:40, after the next event (11:04:23) and 14 seconds before that event's hand-off check.

Finding one event's Depot run

Check timestamps and pull_requests could not identify which Depot run belonged to an event in these cases. Until October 2026, the GitHub Actions relay matched events through the Depot wait job's check name. The name ended with (PR <number>, event <pull_request.updated_at>) because Depot includes evaluated job-name expressions in its check names. The relay built the same name from the GitHub event payload, found that check, and read the Depot workflow ID from its details_url. It then read the gate check for that workflow.

On 2026-09-24, Depot posted check 107656013423 for the relay example with the suffix (PR 105886, event 2026-09-24T13:33:14Z). GitHub relay job 107655803961 matched it using EVENT_AT: 2026-09-24T13:33:14Z and reported success. The relay no longer runs, but this example shows how a check name can identify an event when timestamps and PR associations cannot.

Racing events

Two events of one commit that arrive within a second or two race the concurrency cancel on both engines, and neither engine reliably keeps the newer event. A stack push shows it: it force-pushes a pull request's head and its base about one second apart, and each push starts a pull request event. Measured 2026-09-25 on a stack push at 15:17Z:

  • PR 106429: GitHub Actions cancelled the run of the newer event (15:17:40Z) and kept the older one (15:17:39Z). Depot kept 15:17:40Z and cancelled Depot run rtl932mrbc with "Cancelled due to the workflow concurrency policy".
  • PR 106435: GitHub Actions kept the newer event (15:17:41Z). Depot kept the older one (15:17:40Z) and cancelled nzb661zql2.
  • Neither canceled Depot run posted a wait check. Each surviving GitHub relay found no run for its event and failed after the grace period, although Depot's other run passed on the same commit.

GitHub Actions can also keep the older event. Among the 946 ci-backend.yml pull request runs created on 2026-09-25 between 11:30Z and 16:00Z, 56 same-commit pairs were created within 30 seconds of each other. Of those, 52 pairs were created 0 to 2 seconds apart. GitHub kept the older run in 6 pairs, all 0 to 1 second apart. The relay therefore accepted a Depot run for another event on the same pull request within 2 seconds of its own event, checking newest first. Readers that match events by timestamp need to allow for this race.

The newest check per name tells you the verdict. It does not tell you whether the PR can merge. A cancelled run on the same head keeps its checks, and when one of them is a required check, GitHub's merge box and Trunk keep the PR blocked until that run is rerun. /merging-prs has the recipe.

Superseded runs

Depot's concurrency policy keeps the workflow it created last. A run receives its workflow after the run itself is created, so workflow creation order can differ from event order. On 2026-09-29, across 284 ci-backend.yml pull request workflows, the delay was 55 seconds at the median and 120 seconds at most. In 11 of 165 consecutive run pairs for one pull request, the older run's workflow was created first or in the same second. Two races canceled the event that GitHub Actions had handed off, and the relay failed with "Depot CI started no run for this event":

  • PR 107856: run wq9rjmvr7z for head 056fb05982 was created at 16:09:59Z and got its workflow at 16:11:10Z. Run 0k16ml32s1 for the newer head b9fbb26201 was created at 16:10:18Z and got its workflow at 16:11:09Z, so Depot cancelled 0k16ml32s1.
  • PR 108622: two events of d484f7a101 at 18:29:23Z and 18:29:34Z. GitHub Actions kept the second. Depot kept the first, whose gate passed, and the relay's 2-second racing window did not reach it.

Run creation keeps event order: across 138 pairs of distinct events, each run's created_at followed its event by 1 to 12 seconds and never inverted. Across 356 consecutive run pairs of one pull request, Depot's run order matched GitHub Actions' run order in 355, and the other pair was a same-second tie on GitHub. So .depot/workflows/ci-backend.yml gives each event its own concurrency group, and its cancel-superseded-runs job orders the pull request's runs by run created_at, and the run id breaks a same-second tie on one commit. Each run cancels the older runs it sees, and cancels itself when it sees a newer run, so the run whose workflow Depot creates last settles each pair.

pull_request_target checks

Depot can post a pull_request_target job's check on another pull request's head commit. A pull_request_target run's github.sha is the base branch head, so pull requests opened against the same master commit share it, and every misplaced check measured sat on a commit whose own run shared that base commit. Measured 2026-09-25 on a migration report workflow that ran on pull_request_target: 35 of its 42 checks sat on the wrong commit. For example, check 108123656729 on PR 106758's head 0295b92b41 links Depot workflow ljv421dmlt, whose run vpg4b1kvh7 tested PR 106767's head fb236b6c26, and both runs had base 7af9307723. The jobs' own writes, a check posted with an explicit head_sha and a comment on an explicit PR number, reached the right pull request. Post pull-request-facing results from a pull_request workflow, whose checks land on the right head.

Depot CI CLI recipes

The CLI needs ids that the GitHub API does not carry. Start from a check run's details_url, which encodes the workflow id and job id.

# Job and workflow ids for the depot checks on a commit
gh api "repos/PostHog/posthog/commits/$SHA/check-runs?per_page=100" --paginate \
    --jq '.check_runs[] | select((.details_url // "") | startswith("https://depot.dev/")) | "\(.name)\t\(.details_url)"'

# Everything else, including the run id, from a job id
depot ci diagnose --job <job-id> -o json

depot ci logs <job-id>
depot ci retry <run-id> --workflow <workflow-id> --failed
depot ci rerun <run-id> --workflow <workflow-id>
depot ci artifacts   # artifacts do exist on Depot CI

One Depot run holds every workflow triggered by the same event, so retry and rerun need --workflow whenever more than one workflow ran. GitHub Actions splits the same event into one run per workflow.

Depot CI checks out the pull request merge ref (refs/pull/<n>/merge) and posts its checks against the head sha, matching GitHub Actions.

Known gaps in Depot CI

From Depot's compatibility page, not measured here:

  • Depot does not run fork pull requests. After review, a maintainer re-creates the pull request in the main repository. See Pull requests from forks.
  • environment: is unsupported. For a uses: call to a workflow in another repository, see github-actions-compatibility.md.
  • secrets.GITHUB_TOKEN is a GitHub App installation token, not the Actions token. GitHub Packages rejects it. The rate limit it draws on is the app installation's pool, which is shared across repos and is not the per-repo Actions bucket that monitor-github-rate-limit.yml watches.
  • Non-Depot runs-on labels are treated as depot-ubuntu-latest.
  • Secrets and variables live in Depot's own store (depot ci secrets, depot ci vars), not in GitHub's.