[Security] Use github environment for update-commit-hash workflow (#107060)
Similar to: https://github.com/pytorch/pytorch/pull/101718
https://github.com/pytorch/pytorch/actions/runs/5856611801/job/15876722301
Please note since we can't specify environment for a composite workflow. It was needed to move update-commit-hash as action rather then workflow.
Still todo: Move docs and binary builds
Pull Request resolved: https://github.com/pytorch/pytorch/pull/107060
Approved by: https://github.com/seemethere