Repository navigation
Description
Summary
Move our automated cross-repo commits and PRs (translation-sync, content-sync, activity-report posting, and similar scheduled automation) off a personal token and onto the existing quantecon-services machine account, using its own dedicated fine-grained PAT (an org secret).
Why
- Attribution accuracy. Today these run under a personal token, so they show up as
@mmcky. In the May 2026 activity report that's ~18 translation-sync PRs + ~12 content-sync PRs + maintenance PRs all attributed to a person, which makes it hard to separate human work from automation in our reports. A dedicated bot account fixes this at the source. - Bus factor / security. Automation shouldn't depend on one maintainer's personal PAT. A machine account gives least-privilege, centrally-rotatable credentials that don't break (or leak personal scope) when an individual's token changes.
- Downstream CI. PRs opened by the default
GITHUB_TOKENdon't triggerpull_requestworkflows; a dedicated account's PAT does — so bot-opened PRs (e.g. the new monthly activity report PR) actually get CI.
Good news
quantecon-services is already a registered GitHub user (created 2016, display name "QuantEcon"). So this is provisioning + wiring, not account creation.
Proposed steps
- Generate a fine-grained PAT on
quantecon-services, scoped only to the repos automation writes to, with Contents + Pull requests + Issues = read/write. Set an expiry and a rotation reminder. - Add
quantecon-servicesto a team with write access to the target repos (and branch-protection bypass where automation pushes directly). - Store the PAT as an org-level Actions secret (e.g.
QUANTECON_SERVICES_PAT) so repos share one credential. - Migrate the workflows that currently use a personal token to
secrets.QUANTECON_SERVICES_PAT:QuantEcon/action-translationconsumers (translation-sync into*.fa/*.zh-cn)- content-sync workflows (e.g.
lecture-dp←lecture-python-advanced.myst/lecture-python.myst) - activity-report posting (
QuantEcon/action-activity-reportweekly + monthly) - any other scheduled automation that pushes/opens PRs
- Revoke the personal PAT once everything is migrated and verified.
Alternative to weigh: a GitHub App
A GitHub App (short-lived installation tokens, no PAT expiry, per-repo install, fine scopes) is the sturdier long-term option and avoids PAT rotation entirely. This issue proposes the PAT path as the simplest first step, but flagging the App as the more robust alternative if we'd rather not manage a long-lived token.
Open questions
- Fine-grained PAT vs GitHub App?
- Org-level secret vs per-repo secrets?
- Does adding
quantecon-servicesas an org member consume a paid seat?
Context: surfaced while reviewing the May 2026 monthly activity report (QuantEcon/action-activity-report), where automated PRs dominate and are all attributed to a single maintainer.
Activity
mmcky commentedon Aug 4, 2026
Step 4 is already done, and that changes the shape of what is left. All three live sync workflows in
QuantEcon/lecture-python-programming—sync-translations-{fa,fr,zh-cn}.yml— already authenticate withsecrets.QUANTECON_SERVICES_PAT, the exact secret name this issue's step 3 proposes. The wiring landed at some point without the rest of the plan.But every
translation-sync-*pull request in the fleet is still authored by@mmcky, including three opened on 2026-08-04. So the secret exists and is in use, and it holds a personal PAT rather than aquantecon-servicesone. (Inferred from PR authorship — reading the org secret needsadmin:org, which I do not have. The inference is tight: a services PAT in that secret would produce services-authored PRs.)What that means practically: this is not a 5-step migration any more. Steps 3 and 4 are effectively complete, and what remains is mint the fine-grained PAT, grant write access, swap the secret's value, verify, revoke. No workflow edits at all.
The blocker for step 2, measured
quantecon-servicescurrently holds permissionreadon every translation target —lecture-python-programming.{zh-cn,fa,fr,ml},lecture-python.zh-cn,lecture-intro.zh-cn— and on all threetest-translation-sync.*harness repos. Onlylecture-python-programmingitself grants itadmin. So a services PAT minted today could not create a branch or open a pull request anywhere the automation writes. The account has also authored 0 pull requests anywhere on GitHub, ever.Step 2 is therefore the gate on the whole migration, not step 1, and it is worth reordering to say so.
A benefit not costed here
This issue motivates the move on attribution, bus factor and downstream CI. There is a fourth: it removes GitHub Copilot's automatic code review from every automated PR.
That review follows the PR author's personal account setting, which is account-wide with no repo filter. Measured across 770 Copilot-reviewed PRs in the translation estate, 685 are
@mmckyself-requested within 120 seconds of creation, and no other account has ever triggered an automatic one. The estate has accumulated 774 Copilot review comments, and on the one edition read line by line — the five Malayalam calibration PRs — none of the 29 comments was a translation defect, while a majority argued against that edition's deliberate keep-English policy. Detail in QuantEcon/project-translation#21.Two caveats so this is not over-claimed. The migration covers the automated class only — roughly 30% of comment volume in the production editions; CLI resync PRs shell out through
spawnSync('gh', ...)and inherit the operator's local login, so no secret swap reaches them. And the outcome depends onquantecon-services's own Copilot setting, which is unobservable from outside given the account has no PR history.Three consequences worth carrying into the plan
Notification routing collapses to nobody.
pr-reviewersandpr-team-reviewersare unset in all five live sync workflows and no target repo has a CODEOWNERS file, so the only thing currently routing sync PRs to a human is@mmcky's author-subscription. After the swap every sync PR is unwatched by construction. Setpr-reviewersbefore the secret swap, not after.The first-time-contributor gate becomes live. With zero prior PRs and
readpermission, the account's first PRs would park target-sidepull_requestworkflows ataction_required— includingreview-translations.yml, which fails silently, andci.yml, the preview job whose absence cost the French editor about 30 hours of unpreviewed work. Grant write and burn the first-time flag with one throwaway PR before cutover, and have the verification step confirm the review workflow actually ran rather than merely that it was configured.One open question here has an answer now. On "does adding
quantecon-servicesas an org member consume a paid seat" — the org's Copilot billing currently readstotal seats: 0withseat_management_setting: unconfigured, so no Copilot seat is in play today. That does not settle the general org-membership seat question, but it removes one variable.Also relevant to the PAT-vs-App question: QuantEcon/action-translation#221 records that GitHub Apps always report
author_association=NONE, which would silently break the\translate-resynctrust gate that QuantEcon/action-translation#192 added — a machine user needs no change, an App does. That is an argument for the PAT path this issue already proposes.mmcky commentedon Aug 7, 2026
This rollout is incomplete in a way that is failing silently right now, in at least three repos. Found while independently validating QuantEcon/data-lectures#51.
QUANTECON_SERVICES_PATexists as an org secret and works where it has been granted. But its selected-repository list does not includelecture-intro.zh-cn,lecture-python-programming.zh-cnorlecture-python-programming.fa. In those repos the secret resolves empty, sorebase-translations.ymldies in 2-5 seconds withAction failed: Input required and not supplied: github-token(getRebaseInputs,inputs.ts:137).Evidence —
lecture-intro.zh-cnThe workflow has been dead since
727c91bd(2026-07-21, #273) switched line 61 togithub-token: ${{ secrets.QUANTECON_SERVICES_PAT }}. Every translation-sync merge since has failed:All four failures postdate the commit; both successes predate it. Confirmed against the org-secrets listing:
lecture-intro.zh-cncarriesANTHROPIC_API_KEYandNETLIFY_AUTH_TOKENonly, whilelecture-python.zh-cnadditionally hasQUANTECON_SERVICES_PAT— and its rebase succeeded on 2026-08-07, same day, same workflow. That contrast is what isolates it to the grant rather than the workflow.Why it matters beyond a red X
The consequence is mechanically visible today: six open sync PRs sit four commits behind
main, unrebased since 2026-08-03 despite three merges landing on 2026-08-07 (compare/main...translation-sync-…pr-819→behind_by=4).mainhas no branch protection in that repo (branches/main/protection→ 404, "Branch not protected"), so nothing forces a PR up to date before merge. A queued sync PR can therefore merge content generated against a stale base — which is a quiet correctness risk on top of the visible failures, and it lands in the same repo where QuantEcon/workspace-lectures#25 already showed a sync overwriting a deliberate localisation.The failure mode is the worst kind for a rollout: the workflow runs, goes red for three seconds, and nothing downstream notices. Two repos migrated cleanly and three did not, and the difference is invisible unless you compare secrets listings.
Fix
A repo-access grant on the existing org secret for the three repos — no code change. Worth also confirming the full selected-repository list against every repo that references
QUANTECON_SERVICES_PATin a workflow, since the same gap will exist anywhere else the rollout touched but the grant missed.mmcky commentedon Aug 10, 2026
Adding a fourth repo to the grant list — lecture-python-programming.fr fails the same way and is not named above.
Run 30588869951 (2026-07-30,
Rebase Translation PRs) ends with##[error]Error: Input required and not supplied: github-token, byte-identical to the intro.zh-cn / programming.zh-cn / fa signature. Its last success was 2026-07-18, before the PAT switch.Full live picture as of 2026-08-10, one row per edition, taking the most recent non-skipped run in each (skipped runs mean the trigger condition was not met, not that the workflow is healthy — which is why fr reads clean at a glance):
github-tokengithub-tokengithub-tokengithub-tokenSo the grant needs four repositories added, not three.
Two operational consequences worth recording while this is open, because they invert an assumption the translation programme has been working from. The standing rule has been "the rebase automation overwrites your hand fixes after any merge to main" — that is true on lecture-python.zh-cn only. On the other four the automation is dead, so hand fixes are safe from clobber but branches silently go stale:
gh pr update-branchhas to be run by hand before a green check can be trusted. lecture-intro.zh-cn's six open sync PRs have been drifting behind main for that reason.Recorded on the programme side in project-translation#27 and in the 2026-08-10 register refresh.
mmcky commentedon Aug 18, 2026
Grant extended 2026-08-18 (@mmcky) — the fine-grained PAT repo access now covers the remaining repos. Field verification is scheduled rather than assumed: the next translation-program session (QuantEcon/project-translation#36, item 1) triages the fa/fr backlogs and will observe whether rebase automation comes alive on programming.zh-cn / programming.fa / programming.fr — the three repos with no confirmed non-skipped run. Until that confirms,
gh pr update-branchby hand remains the safe path there.