Title: Consolidate shared workflows into a single generated automation.yml entry point by akolson · Pull Request #88 · learningequality/.github · GitHub
Open Graph Title: Consolidate shared workflows into a single generated automation.yml entry point by akolson · Pull Request #88 · learningequality/.github
X Title: Consolidate shared workflows into a single generated automation.yml entry point by akolson · Pull Request #88 · learningequality/.github
Description: Summary Every consumer repo copies about seven call-*.yml workflows, one per automation. Each one carries its own on: block and its own exhaustive types: list. Adding, removing or toggling an automation therefore means a change in every repo. The types: lists also drift, because a default pull_request_target trigger silently misses labeled, review_requested and assigned. This replaces all of them with one file to copy, automation-template.yml. The template calls a central reusable automation.yml, which dispatches to each leaf workflow based on the triggering event. Routing and on/off control now live in this repo. automation.yml calls the leaves directly instead of going through the old pull-request-target.yml dispatcher. That keeps the chain at caller -> automation.yml -> leaf -> is-contributor.yml, which is GitHub's limit of four levels for nested reusable workflows. The change automation-registry.yml is the source of truth. One entry per automation declares its leaf, trigger events, dispatch if:, secrets and permissions. scripts/generate-automation.js generates automation.yml, automation-template.yml, and automation-caller.yml, which is this repo's own copy of the template. A pre-commit hook and a new CI workflow fail if the generated files drift from the registry. LE_BOT_APP_ID and LE_BOT_PRIVATE_KEY are required. The Slack, spreadsheet and GCP secrets are optional. See the note in reviewer guidance for what that does and does not mean. resolve-bot-pr-threads is the only automation that uses the default GITHUB_TOKEN with write access, so its job gets contents: write and pull-requests: write. Every other job narrows to contents: read. The template's top-level permissions are the union of every enabled automation's permissions. Adding a scope in the registry therefore widens the template as well. Removed the obsolete call-*.yml callers and the pull-request-target.yml, issue-open.yml and issue-label.yml dispatchers. The leaf workflows stay as they are. Automations wired up: Name Trigger review-requested PR review requested pull-request-label PR labeled dependabot-reviewer PR opened by dependabot contributor-pr-reply PR opened holiday-message PR opened, issue comment created issue-open Issue opened or reopened issue-label-header Issue labeled/unlabeled with help wanted good-first-issue-comment Issue labeled with good first issue or help wanted update-pr-spreadsheet PR assigned, unassigned, opened, closed, reopened, edited, review requested/removed community-contribution-label Issue assigned or unassigned contributor-issue-comment Issue comment created resolve-bot-pr-threads PR review comment created unassign-inactive-issues Weekly schedule + manual dispatch No leaf workflow's internal logic changed. This is a routing and packaging consolidation only. Migration Migrating the consumer repos is out of scope here and lands in separate PRs. Merge this one only after those are open, because deleting pull-request-target.yml breaks any repo that still calls it. #86 asks for the org-wide search to be re-run at execution time, to confirm the consumer set. I did that. Eight repos still call pull-request-target.yml: kolibri, studio, ricecooker, kolibri-design-system, le-utils, kolibri-data-portal, kolibri-installer-debian and morango. morango is the one addition to the list in #86. Each of the eight has a migration issue, linked under References. Three further repos still hold a caller file: kolibri-app, kolibri-installer-android and kolibri-image-pi. All three are archived, so Actions do not run there and no migration is needed. References Refs #86. Merging this does not close the tracking issue, because the consumer migrations below are still outstanding. Please close it by hand once they land. One migration issue per live consumer: learningequality/kolibri#15284 learningequality/studio#6135 learningequality/ricecooker#737 learningequality/kolibri-design-system#1328 learningequality/le-utils#238 learningequality/kolibri-data-portal#1165 learningequality/morango#352 learningequality/kolibri-installer-debian#170 Reviewer guidance The table in #86 records what each consumer caller triggers on. I re-checked it against the call-*.yml files in the consumer repos, and the two agree, so every automation here fires on the events it fires on today. To check that yourself: Compare the on: block in automation-template.yml against the callers in a consumer repo, for example kolibri. Every event and type must appear, and the cron must stay 1 0 * * 1. Read the if: on each job in .github/workflows/automation.yml against the table above. Each one must match the trigger that its old caller used. Run node scripts/generate-automation.js --check. It must exit 0. Then edit automation-registry.yml without regenerating, and run it again. It must name the drifted file and exit 1. Run prek run --all-files. All eight hooks must pass, including actionlint over automation.yml and automation-caller.yml. Two behaviour changes are deliberate and worth a second opinion. Consumer repos gain good-first-issue-comment, because none of them copied that caller. And manage-issue-header now runs only for help wanted label events, which is what scripts/manage-issue-header.js already did internally. On the optional secrets: the registry marks five secrets optional, which describes the workflow_call boundary of automation.yml only. The leaf workflows still declare them required, and the steps that use them are not guarded on the secret being set. A repo that omits a Slack webhook will still see that Slack step fail. Making these secrets optional in practice means guarding those steps, which #86 puts out of scope. AI usage I used Claude Code (Sonnet 4.6) to implement this from the architecture in #86, which I directed: a single entry point, a declarative registry with a generator, explicit secrets instead of secrets: inherit, a hard cutover, and pre-commit plus CI enforcement. I reviewed the generated automation.yml and automation-template.yml output. During that review I caught a permissions gap, because resolve-bot-pr-threads needs write access that the other automations must not inherit, and I directed the job-level narrowing before it became a security problem. I then ran a second Claude Code pass as a self-review, before asking for review here. It traced trigger parity against the real consumer callers and found five problems, which I fixed in 0a2d045. The template permissions were hardcoded rather than derived from the registry. unionOn crashed or silently narrowed a trigger when an event appeared both with and without types:. The docs promised a secret failure that does not happen. The drift-check hook skipped commits that touched only the generator. Two dispatchers were left unreferenced. I reviewed each fix, confirmed that the regenerated template and caller were unchanged, and confirmed that prek and CI pass.
Open Graph Description: Summary Every consumer repo copies about seven call-*.yml workflows, one per automation. Each one carries its own on: block and its own exhaustive types: list. Adding, removing or toggling an autom...
X Description: Summary Every consumer repo copies about seven call-*.yml workflows, one per automation. Each one carries its own on: block and its own exhaustive types: list. Adding, removing or toggling an autom...
Opengraph URL: https://github.com/learningequality/.github/pull/88
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:e892cc2c-4ed3-135d-b9f7-21816e757cc9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E014:6A941:DB4B82:11D53D2:6AFFF7DB |
| html-safe-nonce | 82fcd9052b97413a04c220f3cf541e0bee5db4cf6adb95a50e101781afc9e47f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDE0OjZBOTQxOkRCNEI4MjoxMUQ1M0QyOjZBRkZGN0RCIiwidmlzaXRvcl9pZCI6IjMyMTg0OTE5ODQ4MDkyOTM3ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7346811587bc95f657520f3cd9b17c119d7c5491414c083fd7aae19a1275d581 |
| hovercard-subject-tag | pull_request:3927931343 |
| 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/88/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 Every consumer repo copies about seven call-*.yml workflows, one per automation. Each one carries its own on: block and its own exhaustive types: list. Adding, removing or toggling an autom... |
| 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