[viable strict] don't try to push nonexistent commit (#81226)

Issues like https://github.com/pytorch/pytorch/runs/7271166135?check_suite_focus=true shouldn't happen!

This used to not pop up with @swang392's OG implementation, but now that the script returns None, we should add an if.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/81226
Approved by: https://github.com/seemethere, https://github.com/swang392, https://github.com/malfet
diff --git a/.github/workflows/update-viablestrict.yml b/.github/workflows/update-viablestrict.yml
index 2a72927..da4470b 100644
--- a/.github/workflows/update-viablestrict.yml
+++ b/.github/workflows/update-viablestrict.yml
@@ -40,6 +40,7 @@
         id: get-latest-commit
 
       - name: Push SHA to viable/strict branch
+        if: steps.get-latest-commit.outputs.latest_viable_sha != 'None'
         env:
           GITHUB_TOKEN: ${{ secrets.MERGEBOT_TOKEN }}
         run: |