Software Engineering

Automating Repository Hygiene: How GitHub Built Evergreen to Solve Access Management at Scale

As organizations scale their engineering operations and collaborate across organizational boundaries, managing outside collaborator permissions and lifecycle states for digital assets becomes an increasingly complex administrative burden. Repository owners frequently struggle to confirm active access requirements, adjust permissions as projects evolve, and properly archive repositories once their operational utility expires. This manual housekeeping typically results in deferred maintenance, creating latent security vulnerabilities and architectural clutter. To address these systemic challenges within its own shared infrastructure, GitHub engineered Evergreen, an automated application designed to enforce organizational hygiene using native platform features.

Background and the Scaling Dilemma

The modern software development lifecycle relies heavily on cross-functional collaboration, often bringing together internal engineering teams, enterprise customers, external partners, and third-party vendors. Within GitHub, internal personnel—colloquially referred to as "Hubbers"—frequently collaborate with external stakeholders on time-bound product trials, proof-of-concept projects, and professional services engagements.

As the volume of these collaborative initiatives multiplies, tracking permissions, setting review deadlines, and executing timely follow-ups transforms into a resource-intensive manual process. Historically, enterprise administrators relied on ad-hoc spreadsheets or reactive security audits to identify stale repositories and unauthorized users. These methods are inherently prone to human error, delays, and oversight. Recognizing that manual oversight could not sustainably keep pace with enterprise growth, GitHub’s engineering teams sought a programmatic solution that would automate routine administrative workflows without introducing external dependencies or complex auxiliary databases.

Architectural Design: One Brain, Many Hands

Staying Evergreen: How we automated secure access and repo hygiene in a shared org

Evergreen operates as a lightweight Go-based webhook server deployed inside a container, functioning as an automated controller for repository administration. Rather than relying on custom-built external infrastructure or bespoke scheduling services, the application harnesses native platform capabilities. The system relies on a dedicated controller repository that acts as both the timekeeping mechanism and the persistent state store.

Four scheduled GitHub Actions workflows execute on a quarterly cadence, firing repository dispatch events that prompt the Evergreen application to evaluate compliance metrics. The operational schedule is systematically structured:

  • Day 1: Stale repository review, identifying projects devoid of recent human activity and generating warning notices via issues.
  • Day 8: Access review execution, capturing snapshots of active outside collaborators and opening structured checklist issues within target repositories.
  • Day 16: Stale repository cleanup, automatically archiving repositories that remain inactive following the designated grace period.
  • Day 23: Access cleanup execution, automatically revoking permissions for any access reviews left unanswered by authorized personnel.

To prevent premature administrative actions, reviews are initiated two weeks prior to enforcement deadlines. Additionally, every workflow supports manual triggering via workflow dispatch events, allowing administrators to initiate specific steps on demand.

Core Principles: Fail Secure and Git-Centric State Tracking

Evergreen’s operational philosophy is anchored by two foundational design principles: failing securely and preserving data integrity.

Under the principle of secure defaults, if an access review receives no response by the established deadline, the system does not preserve access in anticipation of future confirmation. Instead, access is automatically revoked. This fail-secure posture ensures that administrative inertia cannot inadvertently extend permissions indefinitely. Concurrently, the application operates under a strict non-destruction policy: Evergreen never deletes a repository or its internal contents. Archived repositories remain fully recoverable, and every permission modification is documented within the corresponding repository’s tracking issue. This guarantees that reverting an administrative error requires minimal effort.

Staying Evergreen: How we automated secure access and repo hygiene in a shared org

State management within Evergreen utilizes a file-based paradigm rather than an external database. The status of every managed repository is recorded as a structured JSON file committed directly to the controller repository. These state files capture critical metadata, including repository identifiers, timestamps of last activity, collaborator rosters at the time of review, active permissions, decision timestamps, and authorized reviewers.

Because state is maintained as files within a Git repository, the underlying commit history functions as a comprehensive audit trail. Administrators can investigate historical permission changes using standard version control diagnostics, eliminating the need for specialized auditing pipelines.

Issue-Ops and Granular Authorization Models

To streamline user interaction, Evergreen leverages "Issue-Ops," utilizing native GitHub issues as the primary interface for administrative decisions. When an access review initiates, the application generates a standardized checklist issue within each target repository. Authorized personnel review the listed collaborators and complete the process by checking the boxes of individuals who require continued access and closing the issue.

Upon receiving the issue-closed webhook event, Evergreen parses the selections, retains permissions for verified users, revokes access for unselected accounts, and posts an explanatory receipt comment detailing the exact actions taken.

Access review closures are strictly restricted to authorized platform personnel. If an unauthorized user attempts to close an access review issue, Evergreen automatically reopens the issue and posts an explanatory note. This enforcement guarantees that administrative decisions are restricted to designated repository owners.

Staying Evergreen: How we automated secure access and repo hygiene in a shared org

To ensure notifications reach the appropriate stakeholders without requiring manual maintenance of ownership matrices, Evergreen utilizes a sophisticated fallback resolution chain. This automated routing system identifies responsible internal teams and individuals, ensuring that relevant notifications are delivered directly to the engineers accountable for the project lifecycle.

Operational Rollout and Observability

Deploying automated access management across a large enterprise environment containing thousands of internal engineers and external partners requires a methodical rollout strategy to prevent operational disruption. GitHub implemented several risk-mitigation practices during Evergreen’s deployment:

  1. Dry-Run Execution: Evergreen incorporates a configurable dry-run mode that logs all prospective write operations without altering live repository permissions or states, allowing engineering teams to validate logic against production environments safely.
  2. Comprehensive Internal Communication: Advance organizational announcements ensured that impacted teams anticipated administrative notices, minimizing confusion during the initial review cycles.
  3. Structured Logging and Observability: The application emits structured logfmt telemetry into a dedicated Splunk index, providing deep visibility into edge cases, permission anomalies, and execution metrics.
  4. Rate Limit Management: To comply with platform secondary rate limits governing content creation—specifically thresholds capping requests at 80 per minute and 500 per hour—Evergreen intentionally paces its execution. The controller processes repositories in controlled batches, introduces strategic pauses between content-creation calls, and accounts exclusively for repositories requiring active engagement.

Broader Implications for Enterprise Governance

The development and deployment of Evergreen highlight a broader shift in enterprise software engineering toward self-maintaining infrastructure. By codifying administrative policies into automated workflows built on native platform primitives, organizations can eliminate the overhead associated with manual compliance audits.

The architectural patterns demonstrated by Evergreen suggest that complex governance challenges—ranging from identity and access management lifecycle enforcement to automated asset archiving—can be effectively solved using existing developer tooling. As organizations increasingly prioritize security posture management and operational efficiency, automated governance models like Evergreen establish a repeatable framework for maintaining scalable, secure, and clean digital ecosystems.

Related Articles

Back to top button