From 3d38f83f4ceb2fe1af43d92c48ce0f640f4ed43d Mon Sep 17 00:00:00 2001 From: Yashwanth Anantharaju Date: Tue, 14 Apr 2026 21:27:07 +0000 Subject: [PATCH] fix: expand SHA regex to support SHA-256 (64-char) commit hashes Update input-helper.ts to recognize both 40-char (SHA-1) and 64-char (SHA-256) hex strings as commit SHAs. Rebuild dist/index.js. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dist/index.js | 2 +- src/input-helper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index fe3f317..e42c0d4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2021,7 +2021,7 @@ function getInputs() { } } // SHA? - else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) { + else if (result.ref.match(/^(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$/)) { result.commit = result.ref; result.ref = ''; } diff --git a/src/input-helper.ts b/src/input-helper.ts index 059232f..e0c61e2 100644 --- a/src/input-helper.ts +++ b/src/input-helper.ts @@ -71,7 +71,7 @@ export async function getInputs(): Promise { } } // SHA? - else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) { + else if (result.ref.match(/^(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$/)) { result.commit = result.ref result.ref = '' }