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(ci): deploy the general purpose worker when any path joins its list (#119123)

Shy Alterc5a83d31c371
diff --git a/.github/workflows/container-images-cd.yml b/.github/workflows/container-images-cd.yml
index 285182ed954f..3bacea3d54e4 100644
--- a/.github/workflows/container-images-cd.yml
+++ b/.github/workflows/container-images-cd.yml
@@ -1120,14 +1120,36 @@ jobs:
env:
BEFORE: ${{ github.event.before }}
run: |
- BASE="$BEFORE"
- if [ -z "$BASE" ] || [ "$BASE" = "0000000000000000000000000000000000000000" ] || ! git fetch --depth=1 --no-tags origin "$BASE"; then
- BASE="HEAD^"
+ WORKFLOW=.github/workflows/container-images-cd.yml
+ NO_COMMIT=0000000000000000000000000000000000000000
+
+ BASE="HEAD^"
+ if [ -n "$BEFORE" ] && [ "$BEFORE" != "$NO_COMMIT" ]; then
+ if git fetch --depth=1 --no-tags origin "$BEFORE"; then
+ BASE="$BEFORE"
+ fi
fi
- if git diff "$BASE" HEAD -- .github/workflows/container-images-cd.yml | grep -qE '^\+.*products/subscriptions/backend/'; then
- echo "changed=true" >> $GITHUB_OUTPUT
+
+ general_purpose_paths_at() {
+ git show "$1:$WORKFLOW" | awk '
+ /^ *generalPurpose:$/ { in_list = 1; next }
+ in_list && /^ *- / { print $2; next }
+ in_list && /^ *(#|$)/ { next }
+ { in_list = 0 }
+ ' | sort -u
+ }
+
+ paths_before=$(general_purpose_paths_at "$BASE")
+ paths_after=$(general_purpose_paths_at HEAD)
+ added_paths=$(comm -13 <(echo "$paths_before") <(echo "$paths_after"))
+
+ if [ -n "$added_paths" ]; then
+ echo "Paths added to the general purpose list:"
+ echo "$added_paths"
+ echo "changed=true" >> "$GITHUB_OUTPUT"
else
- echo "changed=false" >> $GITHUB_OUTPUT
+ echo "No paths added to the general purpose list."
+ echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Trigger General Purpose Temporal Worker Cloud deployment