0

I am trying to get hyperlinks to the file diff version of a file shown in the Files tab in github in a PR:

enter image description here

When I click on the file name the url changes from:

https://github.com/x/pull/4985/files

to:

https://github.com/x/pull/4985/files#diff-0155c51c06995041621random6789767nne2e22d8815151e22b9d4c68b8a80

How is github generating this part: #diff-0155c51c06995041621random6789767nne2e22d8815151e22b9d4c68b8a80 - is it possible to calculate this in code via some sha algorithm and create this hyperlink synthetically ?

The reason for doing this, is I want to generate this url to be able to go to this url in a dangerjs check that im writing

Probosckie
  • 1,585
  • 4
  • 25
  • 40
  • Does this answer your question? [Generate line pointer URL into Github Pull Request](https://stackoverflow.com/questions/46383301/generate-line-pointer-url-into-github-pull-request) – Xinhe Wang Jul 12 '22 at 07:34
  • Yes @XinheWang - this is a great resource thanks for the information – Probosckie Jul 12 '22 at 08:17

0 Answers0