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 the /depot retry listener on github actions (#121570)

Raúl Negrón-Oterodfa2b121b5b2
diff --git a/.agents/skills/depot-ci/references/posthog-check-run-semantics.md b/.agents/skills/depot-ci/references/posthog-check-run-semantics.md
index 6cdc0680c353..55882ee9fbcd 100644
--- a/.agents/skills/depot-ci/references/posthog-check-run-semantics.md
+++ b/.agents/skills/depot-ci/references/posthog-check-run-semantics.md
@@ -61,7 +61,8 @@ Depot creates a job's check run when it resolves the job, not when it creates th
## Reruns
GitHub's Re-run button on a Depot check does nothing. GitHub's [checks guide](https://docs.github.com/en/rest/guides/using-the-rest-api-to-interact-with-checks) 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. `.depot/workflows/retry-on-comment.yml` runs `depot ci retry --failed` on the pull request's newest run.
+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.
diff --git a/.github/scripts/retry_depot_pr_run.py b/.github/scripts/retry_depot_pr_run.py
index c936f5b01f55..d4b4cb4aa4e0 100644
--- a/.github/scripts/retry_depot_pr_run.py
+++ b/.github/scripts/retry_depot_pr_run.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Retry the failed and cancelled jobs of a pull request's newest Depot CI run.
-.depot/workflows/retry-on-comment.yml runs this for a `/depot retry` comment.
+.github/workflows/depot-retry-on-comment.yml runs this for a `/depot retry` comment.
See "Reruns" in .agents/skills/depot-ci/references/posthog-check-run-semantics.md.
Standard library only: the job runs this with the runner's python3 before any install.
diff --git a/.depot/workflows/retry-on-comment.yml b/.github/workflows/depot-retry-on-comment.yml
similarity index 79%
rename from .depot/workflows/retry-on-comment.yml
rename to .github/workflows/depot-retry-on-comment.yml
index 64fa625f4a27..734feb4ccaa5 100644
--- a/.depot/workflows/retry-on-comment.yml
+++ b/.github/workflows/depot-retry-on-comment.yml
@@ -1,7 +1,10 @@
# A `/depot retry` comment on a pull request retries the failed and cancelled jobs of its newest Depot CI
# run, without waiting for the rest of the run and without a push that reruns every workflow.
#
-# Depot CI runs issue_comment workflows from the default branch, so pull request code never runs here.
+# This runs on GitHub Actions because Depot CI records a run for every comment, even a skipped one. See
+# "Reruns" in .agents/skills/depot-ci/references/posthog-check-run-semantics.md.
+#
+# issue_comment workflows run from the default branch, so pull request code never runs here.
name: Retry Depot CI from a comment
on:
issue_comment:
@@ -21,16 +24,17 @@ jobs:
concurrency:
group: ${{ github.workflow }}-pr-${{ github.event.issue.number }}
cancel-in-progress: false
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: .github/scripts
+ sparse-checkout-cone-mode: false
- uses: depot/setup-action@15c09a5f77a0840ad4bce955686522a257853461 # v1.7.1
- name: Retry this PR's failed Depot jobs
env:
- DEPOT_TOKEN: ${{ secrets.DEPOT_CI_CANCEL_TOKEN }}
+ DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.issue.number }}
run: python3 .github/scripts/retry_depot_pr_run.py