Keep the owid/public-skills mirror in sync automatically - #22
Conversation
owid/public-skills is a private mirror of this repo, republished inside the org so the skills can be installed as an org-level plugin in Claude Desktop/Web. Until now it had to be synced by hand. This workflow checks the mirror out on every push to main and runs the mirror's own sync-upstream.sh, which merges this repo, regenerates the mirror README (upstream README + a "this is a mirror" notice) and pushes. The sync logic stays in the mirror; this only triggers it. A weekly cron repairs drift if a run ever fails, and it can be re-run by hand via workflow_dispatch. Needs a MIRROR_SYNC_TOKEN secret: a fine-grained PAT scoped to owid/public-skills with Contents: read and write. Without it the first step fails with an explanation rather than a confusing checkout error. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
445f1b9 to
f1934e1
Compare
The first live run failed with a bare "Not Found" from actions/checkout, which reads as though the mirror repo did not exist when in fact the token could not see it. A preflight call names the likely cause instead. checkout@v5 also drops the Node 20 deprecation warning.
5556404 to
1d6e084
Compare
|
Tested end to end against the real mirror before merge, by temporarily letting the workflow fire on this branch. To prove the token can write and not merely read, the mirror’s The resulting README was byte-identical to The first attempt failed with a bare |
GH repo
owid/public-skillsis a private mirror of this repo. It exists because an org-level plugin in Claude Desktop / Claude Web has to be installed from a repo inside theowidorg and it has to be private, so this repo’s content is republished there.This adds
.github/workflows/mirror-to-public-skills.yml, which on every push tomain:owid/public-skills,sync-upstream.sh— merge this repo’smain, regenerate the mirror’s README, push.All the sync logic lives in the mirror; this workflow only triggers it. Nothing about this repo’s own content or CI changes.
Before merging
Add a repository secret
MIRROR_SYNC_TOKEN: a fine-grained PAT scoped toowid/public-skillsonly, with Contents: read and write. The defaultGITHUB_TOKENcannot reach another repository. Without the secret the first step fails with an explanation instead of an opaque checkout error.Notes
README.mdis derived (.mirror/readme-notice.md+ this repo’sREADME.md, regenerated each sync), so it can never drift or need a manual merge resolution.sync-upstream.shfails loudly on a conflict in any file other than that README — which should not happen unless someone commits to upstream-owned files in the mirror.workflow_dispatchallows a manual re-run.🤖 Generated with Claude Code