Title: Open sync pull requests when a consumer's automation.yml drifts by akolson · Pull Request #97 · learningequality/.github · GitHub
Open Graph Title: Open sync pull requests when a consumer's automation.yml drifts by akolson · Pull Request #97 · learningequality/.github
X Title: Open sync pull requests when a consumer's automation.yml drifts by akolson · Pull Request #97 · learningequality/.github
Description: Summary Consumer repos hold a copied automation-template.yml, and nothing checks that the copies still match. A stale copy fails silently: the repo keeps running its old on: block, so a new automation never fires there, with no error and no log line. This adds a workflow that compares each consumer's copy against the template and opens one pull request per repo that differs, in the same shape dependabot uses. There is no accompanying issue, because the change is a byte copy of one file with nothing to author. The change scripts/sync-automation-template.js finds the consumers, compares each copy against the template, and opens or updates a pull request where they differ. A repo in sync gets nothing. A repo with a sync pull request already open gets it updated, never duplicated. .github/workflows/sync-automation-template.yml runs it weekly, on manual dispatch, and when automation-template.yml changes on main. Manual dispatch takes a dry_run input. A concurrency group stops two runs racing to open the same pull request. scripts/sync-automation-template.test.js covers the state machine with an injected client, and asserts the payloads that decide correctness: the write targets the sync branch, carries the template, and keeps the file sha on an update. docs/automation.md describes what the workflow opens, who merges it, and each state that needs a core maintainer. The consumers are discovered, not listed. The workflow walks the org's repos, skips archived ones and forks, and keeps every repo whose .github/workflows/automation.yml calls this repo's automation.yml. This repo's own reusable workflow sits at the same path and does not call it, so that marker excludes it without a special case. Each pull request targets the repo's default branch, which is the only branch GitHub evaluates workflow triggers from. The body is a short explanation of what changed and why the file is generated. kolibri-design-system is the exception: its check-description job fails unless the body carries a Changelog section whose Description is not the placeholder its own template ships with, and a plain explanation has no such section. For that repo the sync reads its template, keeps the Description and Changelog sections, and answers the Changelog fields. Their template opens by asking for unused sections to be removed, so the rest go rather than arriving unfilled. The template is read rather than stored, so it stays current as they change it. Drift is classified by content rather than by dates. The workflow reads the consumer's copy at whatever the last closed sync pull request left behind, its merge commit when merged and its head when closed unmerged. Matching the current template means nothing new has been published since, so the difference came from the consumer: a merged pull request means they reverted it, reported as toolchain-conflict, and a closed one means a maintainer declined it, reported as declined and left alone until the template moves again. Anything else means the template moved on, which is ordinary drift. Dates cannot answer this. A commit carries the date it was written rather than the date it reached main, and the commit that last touched automation-template.yml reads 2026-09-16 while it landed on 2026-09-21 with #88. A consumer merging a sync pull request inside such a window would be told the template had not changed since, and stop syncing. The workflow only proposes. It opens pull requests on a branch, never commits to a default branch, and never merges, approves, or enables auto-merge. Each consumer's own review rules gate the change. There is no bot pre-review. The copy either matches the template or it does not, and the script writes those bytes by construction, so there is no content question a reviewer could answer differently. What the core maintainer decides is whether to accept the file landing in their repo. References Refs #95. Follows #88, which introduced the template and the generator. Reviewer guidance A dry run against the live org finds the eight consumers and reports them all in sync. All eight pre-commit hooks pass, actionlint included, the generator reports no drift, and 68 tests pass. The write path has run end to end in a sandbox org, against real repositories through the real API, by pointing SYNC_ORG at it. Every state was produced there: would-open, opened, updated, declined, toolchain-conflict, and in-sync after a merge. Nothing has run against learningequality, where all eight are in sync and there is nothing to act on. Run GITHUB_TOKEN=$(gh auth token) node scripts/sync-automation-template.js --dry-run. Expect eight rows, all in-sync, and nothing needing attention. Check that the discovered base branches are each repo's default: develop for kolibri, kolibri-design-system and kolibri-data-portal, unstable for studio, release-v0.9.x for morango, and main for the rest. Check that the script never merges and never writes to a base branch. All writes target the automation-template-sync branch, and a test fails if that is changed to a default branch. Read the body kolibri-design-system would receive. Expect two sections, Description and Changelog, with every Changelog field answered. Its check-description job parses that Description field, and the value must not be the placeholder its template ships with. Check that a failure while reading any repo during discovery reports against that repo rather than ending the run. Discovery happens before the per-repo error handling, so it carries its own. To exercise the write path, point SYNC_ORG at a test org with a token scoped to its repos. Discovery only sees what the token can see, so the blast radius is set by the credential rather than by the code being correct. AI usage I used Claude Code to audit the drift across the consumers, to write the script, workflow and tests, and to draft this description. I directed the design decisions: pull requests rather than issues, the workflow doing the copy itself rather than delegating it to an agent, discovering the consumers rather than recording them here, handling kolibri-design-system as a named exception rather than generalising one repo's form into a rule, no bot pre-review on a change with nothing to judge, and human review as a hard constraint. I verified the dry run against the live org, ran the write path end to end in a sandbox org, confirmed the hooks and tests pass, and checked that the payload assertions fail when the write is pointed at a default branch.
Open Graph Description: Summary Consumer repos hold a copied automation-template.yml, and nothing checks that the copies still match. A stale copy fails silently: the repo keeps running its old on: block, so a new automat...
X Description: Summary Consumer repos hold a copied automation-template.yml, and nothing checks that the copies still match. A stale copy fails silently: the repo keeps running its old on: block, so a new automat...
Opengraph URL: https://github.com/learningequality/.github/pull/97
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ad5ac1d6-3c75-286d-1ed2-57ed8b48b8d7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9C14:15DE5D:CFAD37:10F01AB:6AFFF731 |
| html-safe-nonce | b3f4886e71c835018f5e6cc224328e33c7034a1ea5af1194e33d00a0e84e42d9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzE0OjE1REU1RDpDRkFEMzc6MTBGMDFBQjo2QUZGRjczMSIsInZpc2l0b3JfaWQiOiI3MDUzMDAyMjA2NDQxNjMzNTg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3ccb38f4469b06d6e766bb49f854dafe27320c096b35b503f4af5a93836435e0 |
| hovercard-subject-tag | pull_request:4594055633 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/learningequality/.github/pull/97/files |
| twitter:image | https://avatars.githubusercontent.com/u/5203639?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5203639?s=400&v=4 |
| og:image:alt | Summary Consumer repos hold a copied automation-template.yml, and nothing checks that the copies still match. A stale copy fails silently: the repo keeps running its old on: block, so a new automat... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/learningequality/.github git https://github.com/learningequality/.github.git |
| octolytics-dimension-user_id | 3926525 |
| octolytics-dimension-user_login | learningequality |
| octolytics-dimension-repository_id | 647407699 |
| octolytics-dimension-repository_nwo | learningequality/.github |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 647407699 |
| octolytics-dimension-repository_network_root_nwo | learningequality/.github |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width