How does Spacelift handle code merging in Pull Request plans?
Last updated: December 18, 2025
Context
When working with Pull Requests (PRs) in Spacelift, users often need to understand how Spacelift handles code merging during the planning phase, particularly when there are changes in the base branch that haven't been merged into the PR branch.
Answer
Spacelift does not actually merge code for PR plans. Instead, when planning against GitHub PRs (including custom GitHub and GitHub Enterprise apps), Spacelift uses GitHub's "potential merge commit" - a virtual representation of what would happen if the PR were merged into the base branch at that moment, as long as the PR is mergeable.
Important notes about this behavior:
This behavior is consistent across all GitHub integrations, including custom GitHub apps
The "Retry" button on a plan will use exactly the same configuration and code state as the original run - it will not fetch new changes or recompute the virtual merge
If you need to incorporate new changes from the base branch, you'll need to trigger a new run rather than using the retry function
Source: This information is documented in the Spacelift Push Policy documentation.