ci: fix checkout reference in formatting workflow

Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: sb7ac2d84761d3e37k
diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml
index ed59445..93aa386 100644
--- a/.github/workflows/formatting.yml
+++ b/.github/workflows/formatting.yml
@@ -28,7 +28,7 @@
     steps:
       - uses: actions/checkout@v4
         with:
-          ref: ${{ github.head_ref || github.ref }}
+          ref: ${{ (inputs.auto_fix == true && (github.head_ref || github.ref)) || (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.ref }}
           # Need full history for queue-main pushes
           fetch-depth: 0