CI: Enable using labels to control GHA workflows (#64314)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/62852
Sets a global environment variable containing a list of PR labels. For this PR, the PR_LABELS variable looks like:
```
[
"cla signed",
"ciflow/default"
]
```
confirmed in a run: https://github.com/pytorch/pytorch/runs/3490072161?check_suite_focus=true
This information can be used in other workflow steps to control the logic. For example, if I want to force a build, I can label my PR with "force-build" and do something like the following in my build script:
```
if [[ "${PR_LABELS}" = *force-build* ]]; then
python setup.py install
else
#use cached wheel or something
fi
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64314
Reviewed By: driazati
Differential Revision: D30714570
Pulled By: janeyx99
fbshipit-source-id: 80b060ee32643ddd22eb7b8ec548579c7ccf6441