From f6b63ceb9e79ee917ff77ed8ef9f79097ad2cfc6 Mon Sep 17 00:00:00 2001
From: Alfonso Acosta <fons@syntacticsugar.consulting>
Date: Wed, 2 Mar 2022 20:23:19 +0100
Subject: [PATCH] Make 'checkout pull request HEAD' example work for non-PRs

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index b185d46..d43d0a9 100644
--- a/README.md
+++ b/README.md
@@ -184,7 +184,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
 ```yaml
 - uses: actions/checkout@v3
   with:
-    ref: ${{ github.event.pull_request.head.sha }}
+    ref: ${{ github.event.pull_request.head.sha || github.ref }}
 ```
 
 ## Checkout pull request on closed event