Skip to content

ci(sync): request the golden snapshot inline - #406

Merged
samijaber merged 3 commits into
templatefrom
fix/empty-main-workflows
Sep 24, 2026
Merged

samijaber merged 3 commits into
templatefrom
fix/empty-main-workflows

Conversation

@samijaber

@samijaber samijaber commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

inline the contents of create-template-snapshot.yml into sync.yml in the template branch.

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.

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 samijaber changed the title ci(sync): request the golden snapshot inline ci: empty main's .github/workflows Sep 23, 2026
@samijaber
samijaber requested review from a team and shomix and removed request for a team September 23, 2026 18:23
exit 1
fi

dispatch_payload="$(jq -cn \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so how does this run if it doesnt exist on main?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@samijaber samijaber changed the title ci: empty main's .github/workflows ci(sync): request the golden snapshot inline Sep 24, 2026
@samijaber
samijaber merged commit 056f08f into template Sep 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants