[BE] Refactor get_workflow_job_id (#92191)
A noop change that refactors existing codebase and prints a bit more
verbose error message when request fails.
Get rid of `requests` as it inevitable results in flakiness
TODO: Remove in a few days after PR is landed
https://github.com/pytorch/pytorch/blob/4af5939d7ac70cba7f130ab74705080cbda68d7b/.github/actions/get-workflow-job-id/action.yml#L29
Pull Request resolved: https://github.com/pytorch/pytorch/pull/92191
Approved by: https://github.com/kit1980