backup
Snapshot a repository before it changes — so a merge can never lose the code that was there. A reusable GitHub workflow plus a zero-dependency script: compressed, timestamped, rotated, and never full.
100backups kept per repository, the oldest rotated out as new ones arrive
0dependencies — the script runs on the standard library alone
What it does
Before a merge replaces a repository's code, backup takes the state that is
about to be replaced and stores it, compressed, in a dumps repository:
dumps/
drsamonline__ml-kit/
2026-10-24T103000Z/ml-kit.tar.gz
2026-10-24T110000Z/ml-kit.tar.gz
drsamonline__case-kit/
2026-10-24T103000Z/case-kit.tar.gz
One folder per repository, one folder per backup named with the date and time, and inside
it the repository as a .tar.gz.
The two rules that keep it safe
It never fills upEach repository keeps the newest 100
backups, configurable. Past that the oldest is deleted to make room — the most recent
work is always present and the store stays bounded.
It never stopsWhen a dumps repository passes its size cap
(800 MB by default), it rolls to a fresh one instead of failing the job it was
protecting.
A backup step that can fail a deploy is a backup step that gets removed. The rotation exists so that never happens.