There's a project under Apache 2.0 which has an abondoned pull request. I plan to use this code, fix it and merge into my proprietary fork of the main project. This fork is a part of a bigger proprietary project which my company plans to sell. I am aware that GitHub's Terms of Service specify that all pull requests are subjected to the license of the repository they belong to. I can try contacting the PR author & ask them their opinion, but what if they won't respond?
3 Answers
Not only do GitHub's terms of service codify that the submission would be covered under the Apache 2 license, so too does the Apache 2 license itself:
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
...
5 . Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. [...]
So long as Alice submits a PR to an Apache-2-licensed work via a pull-request system managed by a copyright holder of that licensed work, Alice has already agreed, by submitting her contribution in this way, that her contribution is under the Apache 2 license (unless explicitly marked otherwise).
Pull from the fork, not from the PR itself.
The PR must be coming from another GitHub repo which would be a fork of the main one.
That fork must also have a LICENSE file along with commits you are interested in, making it clear that code in PRs is licensed under the same license.
Particularly referencing GitHub's Terms of Service, it is highly likely that the PR can be considered to be licensed under the Apache 2.0 license and therefore your company could happily use it in your proprietary project (assuming you give appropriate attribution etc).
However, "highly likely" is not "certain" (and "highly likely" is just the statement of some guy on the Internet). There is clearly an increased risk of using the code from the PR than there would be of using code which is clearly and definitely licensed under Apache 2.0. Only you and your company can weigh up that increased risk against the value of using the code from the PR; you may wish to consider taking professional advice on this matter.