Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
ci(platform): skip the sync push when the open PR already has the cha…
…nges

Both change checks compare against main, so while a sync PR waited every
hourly run made a new commit with the same files and force-pushed it. The
job now compares the new commit's tree with the open sync branch's and
stops when they match. A moved main still changes the tree, so the branch
is rebuilt then, and a closed PR still gets a new one on the next run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
  • Loading branch information
amitbardos and claude committed Oct 14, 2026
commit 48a883b623bb14c69cbe6bee9f09c2c6b11f31bf
8 changes: 7 additions & 1 deletion .github/workflows/sync-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ jobs:
git checkout -B "$BRANCH"
git add packages/platform/asyncapi.json packages/platform/src/modules/builder.events.generated.ts
git commit -m "chore(platform): sync asyncapi.json and the event types from production"

pr=$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number')
# An open sync PR whose branch already has this exact tree needs no new commit or force-push.
if [ -n "$pr" ] && git fetch --depth=1 origin "$BRANCH" && [ "$(git rev-parse 'HEAD^{tree}')" = "$(git rev-parse 'FETCH_HEAD^{tree}')" ]; then
echo "✅ #$pr already has these changes"
exit 0
fi
# Rebuilt from main every run, so the branch never drifts or conflicts.
git push --force origin "$BRANCH"
Comment thread
amitbardos marked this conversation as resolved.

pr=$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number')
body="Refreshes \`packages/platform/asyncapi.json\` from $ASYNCAPI_URL and regenerates \`builder.events.generated.ts\`. The docs build and the Platform SDK tests passed on this change. Checked against production every hour."
if [ -z "$pr" ]; then
gh pr create --head "$BRANCH" --base main --title "Sync Platform SDK events from production" --body "$body"
Expand Down
Loading