Evergreen helps keep pull requests green and mergeable by fixing CI failures and keeping PR branches up to date with the base branch.
Because every repo defines "mergeable" differently, Evergreen is installed by an agent that reads repo history, learns local rules, asks for your preferences, and creates a workflow tailored to the repo.
Ask an agent to research your repo and guide you through the installation:
Install the Evergreen Agentic Workflow using:
https://github.com/githubnext/evergreen/blob/main/INSTALL.md
The installer will:
- Read the target repo's guidance, workflows, skills, settings, and last 50 closed PRs.
- Infer the repo's mergeability policy and ask you to confirm it.
- Copy
workflows/evergreen.mdandworkflows/shared/into.github/workflows/. - Configure repo policy in
.github/workflows/shared/evergreen/repo-policy.md. - Run
gh aw compileand include the compiled.lock.yml. - Create labels, secrets, or settings changes when you approve and permissions allow.
- Open an installation PR.
After installation, apply the evergreen label to any PR you want Evergreen to target.
Evergreen wakes on the configured schedule or manual dispatch, selects an eligible evergreen PR, and runs deterministic preflight first. The base preflight checks labels, configured CI gates, active leases, and the current head SHA without checking out PR code. Installers add repository-specific quota, draft, trust, and other merge gates during setup.
If work is needed, Evergreen checks out the approved PR head, reads CI and merge-gate evidence, runs configured repo commands, and prepares a repair. Safe outputs then apply allowed writes: PR-branch commits, labels, comments, and CI activation. Each write is reloaded and verified before Evergreen says it happened.
It can fail if the PR head changes, labels disappear, quota runs out, CI logs or tools are unavailable, a patch fails to apply, a push is rejected, or GitHub cannot update the branch cleanly. Evergreen should report the blocked operation instead of claiming success.
The main boundary is untrusted PR input: code, comments, logs, branch names, and artifacts. Public or fork PRs should require trusted approval before code execution.
Evergreen should use GITHUB_TOKEN where possible. Repos that need automation-triggered CI may opt into a scoped EVERGREEN_GITHUB_TOKEN or app token.
Evergreen v1 should not directly merge PRs or write to the base branch, though making a PR green may let GitHub auto-merge it if the repo already has auto-merge enabled.
Evergreen is available under the MIT License.