git - Github API - Get contents of tag instead of master -
as per documentation of github api - https://developer.github.com/v3/repos/contents/ contents of repo or file, should using get /repos/:owner/:repo/contents/:path
based on that, if want contents of package.json file in repo - https://github.com/fastly/epoch/tree/master (this repo used example), should "/repos/fastly/epoch/contents/package.json"
. directly contents of package.json file on master.
however in case want contents of package.json file 1 of tags i.e. - https://github.com/fastly/epoch/tree/0.6.0
i tried whatever available in github api tags , trees, nothing helpful here - https://developer.github.com/v3/git/trees/ , https://developer.github.com/v3/git/tags/
how can contents of file under tagged branch?
looking @ contents api documentation looks use query parameter this. using example, issue get
to
/repos/fastly/epoch/contents/package.json?ref=0.6.0
a curl request more like
curl https://api.github.com/repos/fastly/epoch/contents/package.json?ref=0.6.0
Comments
Post a Comment