Subscriber Setup
Discovery Workflow
Section titled “Discovery Workflow”Use .github/workflows/template-sync.yml in subscriber repositories.
Required workflow environment:
env: TEMPLATE_SYNC_DEFAULT_UPSTREAM_REPO: octo-org/template-repo TEMPLATE_SYNC_PACKAGE: template-subscriber-migration-system@latestThe workflow runs daily and can be triggered manually.
What It Does
Section titled “What It Does”subscriber-template-sync:
- Reads subscriber state from repository variables.
- Reads the upstream template repository from
TEMPLATE_SYNC_UPSTREAM_REPOorTEMPLATE_SYNC_DEFAULT_UPSTREAM_REPO. - Selects the newest non-draft, non-prerelease
template-migration/release. - Skips if that migration was already opened, applied, or declined.
- Skips if another open
template-migrationPR exists. - Creates a placeholder branch and draft PR.
- Labels the PR with
template-migration. - Writes
TEMPLATE_SYNC_LAST_HANDLED_MIGRATION_ID.
State Variables
Section titled “State Variables”| Variable | Meaning |
|---|---|
TEMPLATE_SYNC_LAST_HANDLED_MIGRATION_ID | Newest migration opened, applied, or declined. |
TEMPLATE_SYNC_LAST_APPLIED_MIGRATION_ID | Newest migration applied successfully. |
TEMPLATE_SYNC_LAST_DECLINED_MIGRATION_ID | Newest migration declined by a maintainer. |
TEMPLATE_SYNC_UPSTREAM_REPO | Optional subscriber-specific upstream override. |
Private Upstream Repositories
Section titled “Private Upstream Repositories”If the template repository is private, set TEMPLATE_SYNC_UPSTREAM_READ_TOKEN in each subscriber. If omitted, the bot token is reused.