ci(sync): request the golden snapshot inline - #406
Merged
Merged
Conversation
main ships in every clone of the starter, so it must carry no workflow files. The sync dispatched create-template-snapshot.yml on main purely because it needed a dispatch target; the request itself is a single API call and sync.yml already holds the pushed main SHA at that point. Moving it here rather than into BuilderIO/agent-native: the monorepo only ever pushes the template branch and never learns the main SHA the merge plus overlay produces, so it would have to poll for main to advance and could bake the wrong commit. Secrets are repo-level, so nothing needs reconfiguring.
main is machine-written by sync.yml, so the workflow has to be removed through the overlay delete list rather than by a commit on main. apply.mjs runs after the .github restore, so deleteListed drops it on every sync and stays idempotent.
samijaber
requested review from
a team and
shomix
and removed request for
a team
September 23, 2026 18:23
kylefowler
reviewed
Sep 23, 2026
| exit 1 | ||
| fi | ||
|
|
||
| dispatch_payload="$(jq -cn \ |
Contributor
There was a problem hiding this comment.
so how does this run if it doesnt exist on main?
Contributor
Author
There was a problem hiding this comment.
This sync.yml workflow only triggers on pushes to the template branch, where it does exist:
name: Sync template into main
# Vendor-branch mirror (starter side). The monorepo pushes the post-processed
# templates/chat to this repo's `template` branch; this workflow git-merges that
# branch into `main`, preserving the private customization layer, then applies the
# Fusion starter overlay from `.github/starter-patch/`.
#
# It lives on the `template` branch ONLY (never `main`) so it doesn't ship in a
# clone of the default branch. Because it runs on push to `template` and only
# GITHUB_TOKEN is used to push `main`, there's no recursion.
on:
push:
branches: [template]
workflow_dispatch:
create-template-snapshot.yml needed to exist on main because it was being triggered via the "Dispatch workflow" API. But if we inline its contents into sync.yml, there is no more need for any job to be in main anymore.
pabloelisseo
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
inline the contents of create-template-snapshot.yml into
sync.ymlin thetemplatebranch.doing that so that we dont have any github workflows in the branch cloned by Code, because doing so fails migrating to github.
#408 deletes the actual unneeded workflow. Must merge this PR first.