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.

fix(stamphog): sticky comment lookup broken by --slurp with --jq (#68870)

Julian Bezcd89ae867dc1
diff --git a/.github/workflows/pr-approval-agent.yml b/.github/workflows/pr-approval-agent.yml
index 9c448f3e30ac..8146e2269a22 100644
--- a/.github/workflows/pr-approval-agent.yml
+++ b/.github/workflows/pr-approval-agent.yml
@@ -135,12 +135,13 @@ jobs:
# Author + leading-marker filter: on a public repo anyone can
# post a comment containing the marker; without the filter the
# bot would PATCH (clobber) a third-party comment. Slurp so the
- # jq runs once over all pages — per-page --jq could emit one
- # object per page. The || guard keeps a transient lookup
- # failure from aborting the step before the label strip below
- # (it degrades to posting a fresh comment instead).
+ # jq runs once over all pages (per-page filtering could emit
+ # one object per page); gh rejects --slurp combined with --jq,
+ # so pipe to standalone jq. The || guard keeps a transient
+ # lookup failure from aborting the step before the label strip
+ # below (it degrades to posting a fresh comment instead).
EXISTING=$(gh api "repos/$REPO/issues/$PR/comments" --paginate --slurp \
- --jq "[.[][] | select(.user.login == \"$BOT_LOGIN\" and (.body | startswith(\"$MARKER\")))][0] // empty" \
+ | jq "[.[][] | select(.user.login == \"$BOT_LOGIN\" and (.body | startswith(\"$MARKER\")))][0] // empty" \
|| echo "")
COMMENT_ID=""
EXISTING_BODY=""