Repository navigation
[sync] Synced only the children whose source directory a push changed. - #11
Conversation
A push now starts a sync job only for the targets whose `source.root` it touched, or for every target if it changed the configuration file. A run started by hand, a push which created its branch, or one whose earlier commit can't be fetched still syncs every target. The README recommends restricting the push trigger to the branches synced from, as GitHub Graph's own sync.yml now does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (PR review agent)Approved. @SgtSwagrid asked me directly to land this series. A push now syncs only the children whose Note, not blocking: a child that syncs files from outside its Merging. |
Summary
A push to a source with several children started a sync job for every child, even when it touched nothing that child syncs from. Themis, which syncs four library directories, paid four billed minutes for every merge, most of which change none of them (about 570 billed minutes in the last month). Now a push starts a job only for the children whose
source.rootit changed.Changes
parse-config.shdiffs the push (github.event.before..GITHUB_SHA, fetching the earlier commit into the shallow checkout) and keeps only the children with a changed file under their source directory. A child rooted at.always syncs..github/graph.json, on a run started by hand, on a push that created its branch, and when the earlier commit can't be fetched.--no-renames), so moving a file out of a directory still syncs that directory's children.sync.ymltriggers on pushes tomainonly, and the README now recommends the same for callers: a push to any other branch starts a job that finds nothing to sync. Themis's 293 such jobs last month were all billed.Testing
Ran
parse-config.shin a throwaway Actions run (since deleted) against a config with rootsscripts,./scripts/,templates,docsand the default.:scripts,./scripts/,.workflow_dispatch.onlybeforegiven🤖 Generated with Claude Code