Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github API ... Getting source filename on a moved / renamed file

Tags:

php

github

api

Im currently working on a cms, and building an ajax / php remote updater script. The cms files are located on Github, and im using the API to get the file changes and source of those changes. As you can see here: https://api.github.com/repos/Plexis/Plexis/commits/116743cefde6765a4d4a8d0558bd17c4908dd586

Under "files" it lists all the changed files. The problem is, renamed / moved files. I cant seem to get a solid idea of how to get the original file so i can unlink it with php. If i try to get all the trees, that can take a ajax request per directoy... That's just too much. Anyone have an idea where i can get the source file's name and location before it was renamed / moved?

like image 328
Wilson212 Avatar asked Nov 14 '22 11:11

Wilson212


1 Answers

Might ask your changes as you're doing now, then for new files do not exist or could you try

https://api.github.com/repos/{user}/{repo}/commits?path={file.path}

for get her history. You can try with the hast too, the hash is the same event if the file has a diferent name

like image 93
rkmax Avatar answered Nov 16 '22 03:11

rkmax