[GHA] Small refactors (#65647)
Summary:
Introduce `main` method in generate_ci_workflows
Check that all `ciflow/` labels start with the same prefix
Move `ciflow_should_run` defenition to common.yml.j2
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65647
Reviewed By: janeyx99
Differential Revision: D31189537
Pulled By: malfet
fbshipit-source-id: 7cc47f63fb334c57f450034b931ff5bae1c0ed8b