1
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2026-05-07 02:17:36 +02:00

fix: expand merge commit SHA regex and add SHA-256 test cases (#2414)

* fix: expand merge commit SHA regex and add SHA-256 test cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: add checkCommitInfo SHA coverage

Add checkCommitInfo tests for SHA-1 and SHA-256 merge messages and reject invalid 50-character hex merge heads.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* style: fix Prettier formatting in test and source files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Yashwanth Anantharaju 2026-05-04 13:30:55 -04:00 committed by GitHub
parent 0c366fd6a8
commit 900f2210b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 164 additions and 4 deletions

View file

@ -71,7 +71,7 @@ export async function getInputs(): Promise<IGitSourceSettings> {
}
}
// 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 = ''
}