Blog About Me Posts By Tags Subscribe Elastic Search My Sessions Terraform

Pavan Kumar Aryasomayajulu


Javascript Code Snippet For Getting List Of Modified Files In A Github PullRequest

Hi, In this post I would like to share a small js code snippet which I use from Console of a browser to list all the files that were changed with the pull request. My usecase is usually I review pull request created my team mates and sometimes we will have 100’s of files changed and when reviewing in the web and finding what all files changed , In that process I usually get confused. So I am planning to get all files changed and planning to copy them to an excel file and when I am done with my review of particular file, I can mark it as completed.

var elems = document.getElementsByClassName("link-gray-dark");
for (var i = 0; i < elems.length; i++) {
  var link = elems[i].innerText;
  console.log(link);
}

Note: This might have some junk output but that is very minimal and it helps me solve my purpose

#CodeSnippets #Github_Pull_request_files_list