automate hash pinning (#79470)
automate the pr approval and merging of hash pinning
also switch to a python script for easier control flow
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79470
Approved by: https://github.com/seemethere