well ur stealing from burglars, so the way to go is to announce what ur doing with full disclosure
It would depend entirely on the license of that code which will almost certainly be the same as the license for the base repo in the outlined case.
Most common licenses (MIT, BSD, GPL-2, GPL-3) would allow copying the code without any issues