GitHub-Actions-mirror-repository: The Automation Exoskeleton

How a detached hub uses SSH keys and cron jobs to bring modern automated builds to a legacy C compiler without altering its source code.

6 min read • View on GitHub • More from Tiny-C-Compiler

A modern robotic arm manipulating an antique brass astrolabe using fine strings. This represents the automation exoskeleton cleanly operating a legacy codebase.
The manager repository acts as an external orchestrator, feeding automation to a legacy upstream project without touching its core files.
Key Takeaways

The YAML Pollution Problem

Modernizing legacy open-source projects presents a philosophical dilemma. Developers expect automated binaries and GitHub Releases. But foundational projects like the Tiny C Compiler (TCC), hosted entirely outside the GitHub ecosystem, lack these features.

Bolting GitHub Actions directly into a mirror branch creates messy merge conflicts and pollutes the original commit history. The maintainers needed a way to provide modern amenities without corrupting the source of truth.

Architecture of a Shadow Repo

The solution is a strict separation of concerns. The maintainer created a detached "manager" repository that acts as a pure orchestrator. It uses a cron schedule to pull the active development branch from the upstream host.

Once the code is pulled, the manager pushes it to a separate GitHub mirror. It uses stored SSH private keys to bypass default token limitations, maintaining a cryptographically clean 1:1 clone of the original code.

The air-gapped CI pipeline isolates operational concerns from the core codebase.

Cross-Compiling on Borrowed Hardware

The exoskeleton does more than just mirror code. It actively provisions infrastructure. The release workflow downloads the freshly synced code and provisions a standard Ubuntu runner.

Using the mingw-w64 toolchain, the Linux environment cross-compiles native Windows binaries. This capitalizes on the extreme portability of C, turning cheap Linux compute into a dedicated Windows build farm.

A classic wooden Gutenberg-style printing press stamping out perfectly formed metal gears. This illustrates a Linux environment manufacturing artifacts for a Windows environment.
Cross-compilation allows a Linux environment to manufacture artifacts for entirely different operating systems.

we use tcc for serious (production) work - as a JIT to build performance critical parts that aren't appropriate to build in the scripting language that the rest of tha 300k line codebase is built in

Cyan Ogilvie, Tinycc-devel Mailing List Contributor · Tinycc-devel Mailing List

Outsmarting the Platform Reaper

GitHub aggressively disables scheduled workflows in repositories that lack recent commits. Because this manager repository is designed to be "set it and forget it," it faces a constant risk of being shut down.

To survive, the project uses a keep-alive workflow. This specialized composite action programmatically pings the GitHub API, resetting the timeout clock and ensuring the automation never sleeps.

Monorepo vs. Exoskeleton

The industry standard is to keep CI/CD configuration directly alongside source code. But for mirrors and legacy preservation, the exoskeleton pattern proves superior.

FeatureInline CI/CDDetached Manager Repo
Codebase CleanlinessPolluted with .github foldersPristine 1:1 upstream match
MaintenanceSimple single-repo updatesRequires SSH key management
Upstream CompatibilityCauses merge conflicts on pullZero impact on source history