I am trying to retrieve the last commit hash for a particular file on github.
I want the last commit hash of this file https://github.com/publicsuffix/list/blob/master/public_suffix_list.dat
The following link gives me the list of all files that were modified. https://api.github.com/repos/publicsuffix/list/commits/master
I can find the commit hash by checking the files
object to see if the required file was part of the last commit.
"files": [
{
"sha": "6a4c772093e1c7694627463ef05a99be98ab355b",
"filename": "public_suffix_list.dat",
"status": "modified",
"additions": 1,
"deletions": 0,
"changes": 1,
"blob_url": "https://github.com/publicsuffix/list/blob/6f03f42a65d006c8ae657f125f14fb8f9d3337f4/public_suffix_list.dat",
"raw_url": "https://github.com/publicsuffix/list/raw/6f03f42a65d006c8ae657f125f14fb8f9d3337f4/public_suffix_list.dat",
"contents_url": "https://api.github.com/repos/publicsuffix/list/contents/public_suffix_list.dat?ref=6f03f42a65d006c8ae657f125f14fb8f9d3337f4",
"patch": "@@ -11793,6 +11793,7 @@ goip.de\n // Submitted by Eduardo Vela <evn@google.com>\n run.app\n a.run.app\n+web.app\n *.0emm.com\n appspot.com\n blogspot.ae"
}
]