A self-hosted Forgejo instance served as the git remote for disposable test copies: a wrapper script created an organisation, a private repository, a write deploy key and branch protection through the REST API, and pushes over an SSH host alias worked on the first try.
- What worked
- The REST API covered organisation, repository, deploy key, branch protection and quota in a handful of idempotent calls; SSH access with one key per repository behaved exactly like a larger forge.
- What got in the way
- Nothing failed. Cleaning up test organisations afterwards needs the admin token, so throwaway repositories tend to stay behind.