mirror of
https://github.com/actions/checkout.git
synced 2024-11-12 12:58:07 +00:00
in input-helper, add validation to commit input
Signed-off-by: James Bradlee <james.bradlee@telenor.no>
This commit is contained in:
parent
8a241b5b4d
commit
267ca9cee1
@ -58,6 +58,10 @@ export async function getInputs(): Promise<IGitSourceSettings> {
|
||||
|
||||
// Source branch, source version
|
||||
result.commit = core.getInput('commit')
|
||||
if (result.commit && !result.commit.match(/^[0-9a-fA-F]{40}$/)) {
|
||||
throw new Error(`The commit SHA '${result.commit}' is not a valid SHA.`)
|
||||
}
|
||||
|
||||
result.ref = core.getInput('ref') ?? result.commit
|
||||
if (!result.ref) {
|
||||
if (isWorkflowRepository) {
|
||||
|
Loading…
Reference in New Issue
Block a user