GitHub mirror: a README notice shown only on GitHub, pointing to the official repository #938
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#938
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Postulo lives on Forgejo and is mirrored to GitHub. On GitHub, and only there, the README should open with a notice that the repository is a read-only mirror, and that issues, suggestions and pull requests belong on the official repository at source.tiagoagueda.com. The mirror should stay a plain, byte-for-byte copy: no separate branch to keep rebased.
How: the two forges pick a README differently
.github/README.mdfirst. Its order is the.github/folder, then the root, thendocs/(GitHub docs, About READMEs; confirmed in practice here).README.md. It looks indocs/,.gitea/or.github/only when the root has none (the change that added the fallback).So a
.github/README.mdin the repository changes only what GitHub shows. It travels with every mirror push like any other file. Confirm Forgejo's order against the running version before relying on it.What would change
Generate
.github/README.mdfromREADME.md, never by hand. A small script (scripts/github_readme.py, or a pre-commit step) writes it as:The notice is in English, like the rest of the README.
Rewrite the relative links. GitHub resolves relative links from the README file's own folder, so
src/postulo/static/brand/logo-256.pngorCHANGELOG.mdwould break from.github/. The script rewrites them either to../…or to absolute links on Forgejo. Absolute links are better: they also send readers to the official repository.Check it in CI. A test (or a check in the existing lint job) fails when
.github/README.mddiffers from what the script would write, the waymessages.py extract --checkkeeps the catalogues current. A README change then can't land without the mirror's copy.GitHub settings, set once by hand and written down in CONTRIBUTING.md:
Document the mirror in CONTRIBUTING.md:
.github/README.mdis generated.Caution: Forgejo also reads
.github/.github/for issue and pull request templates when.forgejo/and.gitea/have none..github/workflowswhen.forgejo/workflowsis missing..forgejo/, so Forgejo never picks up the GitHub one. Add a test that asserts this.Related
#936 and #937 (README changes). The generated copy picks those up automatically.