[ci] fix GITHUB_ACTIONS env var checks
`GITHUB_ACTIONS` is set to `true`, but some of our code checks that it
is `1`. Make the checks more general.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79290
Approved by: https://github.com/janeyx99