.github: Fix --no-build-suffix (#62739)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62739

Original flag didn't initially work correctly so this makes it actually
output the right thing

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Test Plan: Imported from OSS

Reviewed By: janeyx99

Differential Revision: D30107694

Pulled By: seemethere

fbshipit-source-id: 5ff28d6820b9cf7145dbb617b86a941bf7686b5c
diff --git a/.github/scripts/generate_pytorch_version.py b/.github/scripts/generate_pytorch_version.py
index 44ed5e5..0655df1 100755
--- a/.github/scripts/generate_pytorch_version.py
+++ b/.github/scripts/generate_pytorch_version.py
@@ -65,6 +65,8 @@
         self.no_build_suffix = no_build_suffix
 
     def get_post_build_suffix(self) -> str:
+        if self.no_build_suffix:
+            return ""
         if self.gpu_arch_type == "cuda":
             return f"+cu{self.gpu_arch_version.replace('.', '')}"
         return f"+{self.gpu_arch_type}{self.gpu_arch_version}"
@@ -87,9 +89,9 @@
     )
     parser.add_argument(
         "--no-build-suffix",
-        type=strtobool,
+        action="store_true",
         help="Whether or not to add a build suffix typically (+cpu)",
-        default=os.environ.get("NO_BUILD_SUFFIX", False)
+        default=strtobool(os.environ.get("NO_BUILD_SUFFIX", "False"))
     )
     parser.add_argument(
         "--gpu-arch-type",