[ci] add a script to get the workflow job id
This is inexplicably not available in the runtime environment of a job,
so we need to retrieve it using the GH API.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74118
Approved by: https://github.com/janeyx99