Can GitHub block merges for noncompliant dependency licenses now?
Yes. GitHub can block merges with active rulesets that require license compliance results before merging, while evaluate mode only annotates pull requests and does not block them.
If you want to ask a follow-up rather than read one: Join a community
Can GitHub block merges for noncompliant dependency licenses now
Yes. GitHub can block merges for dependency license violations when you enforce an open source license policy with an active ruleset that requires license compliance results before merging. In evaluate mode, GitHub only annotates the pull request and does not block the merge.
GitHub’s license compliance feature is built around branch rulesets. When a pull request changes package manifests, GitHub compares the dependency changes between the base branch and the pull request branch, evaluates the detected licenses against your policy, and reports violations. If the ruleset is active, the merge stops until the violation is resolved.
The part people get wrong is assuming license review is just a report. GitHub can use the dependency graph to read dependency data, including transitive dependencies, and then enforce a policy that treats some licenses as disallowed. That means a dependency can fail a merge even when the package was not added directly by the author of the pull request.
The inconvenient part is that this is not automatic everywhere. GitHub says open source license compliance is enforced through branch rulesets, and the feature is tied to the repository or organization policy you configure. If you do not set an active ruleset with the license-compliance condition, GitHub can surface the issue without stopping the merge.
For teams that want a gate, the workflow is straightforward. Enable the dependency graph on the repositories you want to evaluate, define which licenses are allowed or disallowed, and turn on the ruleset condition that requires license compliance results before merging. GitHub also supports exceptions through enterprise license managers when a specific dependency is approved.
For teams that only want visibility, evaluate mode is the safer first step. GitHub runs the license checks, adds annotations to the pull request, and leaves the merge open. That lets you see which manifests and transitive dependencies are causing the policy hit before you decide whether to block or exempt them.
This works best when you treat license compliance like code review, not like a one-time audit. A merge can be blocked by a change in a lockfile, a manifest, or a transitive dependency brought in by another package. The same pull request can also pass one day and fail later if the dependency set changes, because the policy is applied to the dependency graph at review time.
If you need a simple answer for a policy document, write it this way: GitHub can block merges for noncompliant dependency licenses, but only when you use active rulesets with license compliance enforcement. If you use evaluate mode, GitHub warns you and annotates the pull request instead of blocking it.
In practice, that gives you two control levels. One level tells maintainers what is wrong. The other level stops the merge until the dependency set matches your policy. GitHub’s documentation separates those two outcomes clearly, so the enforcement behavior is a configuration choice, not a limitation of the platform.
A concrete example helps. Suppose a pull request adds a package whose license is not allowed by your organization’s policy. GitHub checks the changed manifests, compares the dependency graph, and marks the pull request as violating policy. With active enforcement, the merge is blocked. With evaluate mode, the pull request stays mergeable, but the violation is visible.
This is useful for compliance teams because the gate is applied before code lands on the default branch. It is also useful for developers because the reason for the block is tied to the dependency change, not to a vague policy label. The result is less guesswork when someone needs to replace, remove, or seek approval for a package.
If you want to link this to your own workflow, DevConnect has a place for people testing and shipping apps, and you can keep the discussion focused on the rules you actually enforce: https://devconnectplatform.com. The key point stays the same, GitHub can block merges for license noncompliance if you turn on active license rules.
The current answer is yes, with a condition. GitHub can stop the merge when open source license compliance is enforced through active branch rulesets. It will not block merges by default, and evaluate mode alone is not a block. The enforcement switch is the difference between a warning and a gate.
If you are documenting this for a team, include the policy source, the allowed license list, and whether the repository is in evaluate or active mode. That keeps the rule auditable and avoids the common mistake of assuming a visible warning already means the merge cannot happen.
Frequently asked questions
Does GitHub check direct and transitive dependencies for license policy
GitHub’s license evaluation uses dependency data from the repository, including transitive dependencies detected in the dependency graph.
Is evaluate mode enough to stop a merge
No. GitHub says evaluate mode runs license checks and annotates the pull request, but does not block merges.
What feature actually enforces the block
GitHub says open source license compliance is enforced through branch rulesets, and active rulesets with the license compliance condition can block merges.
Can GitHub allow exceptions for a specific dependency
Yes. GitHub documentation says enterprise open source license managers can approve package or license exceptions.
Know someone stuck on this? Send them the answer.
Sources
Every link here was fetched and confirmed to resolve before this page went live.
- About open source license compliance - GitHub Docs
- Dependency graph - GitHub Docs
- About rulesets - GitHub Docs
- Managing and standardizing pull requests - GitHub Docs
- Configuring open source license policies - GitHub Docs
- GitHub Advanced Security license billing - GitHub Docs
Related questions
- Block noncompliant dependencies before GitHub merges
- Do GitHub dependency PRs now check open source licenses before merge?
- Set Up GitHub License Compliance Checks on PRs
Not the question you had?
Ask it. Every source gets fetched and checked before anything goes up, so it takes a day or two, and questions that cannot be answered honestly do not get a page at all.
Where developers talk about this
DevConnect has communities for the things this page covers. Smaller than the big forums, and nobody is farming engagement.