mirror of
https://code.forgejo.org/actions/checkout.git
synced 2026-04-20 05:50:26 +03:00
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>
This commit is contained in:
parent
0c366fd6a8
commit
3d38f83f4c
2 changed files with 2 additions and 2 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
|
|
@ -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 = '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = ''
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue