git - Travis CI 如何只获取变更文件?
phpcn_u1582
phpcn_u1582 2017-05-02 09:43:15
0
2
740

Hi,我在维护staticfile时候产生了这样的需求:需要校验其他人提交的PR是否符合规范

但是staticfle这个库很大,如果每一次pr和提交都要git clone一遍的话,会产生很多没有必要的流量。请问有没有什么办法可以获取这一个PR中更新的文件?

比如说这样的一个PR:https://github.com/staticfile...

我需要校验他提交的package.json是否符合规范,文件是否都放到了符合规则的地方。

phpcn_u1582
phpcn_u1582

reply all(2)
淡淡烟草味

This is an interesting question. I checked the Github API and found that there is such an API: List pull requests files.

I think you can try to call this API to get the PR updated file. Whether it is placed in a place that meets the rules, you can directly judge from the file URL. And whether the file meets the specifications, you can directly access the file content through the URL. check.

PHPzhong

Can I add it to the cache and then go to the directory to perform a pull?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!