mirror of
https://github.com/actions/checkout.git
synced 2026-02-14 07:34:49 +08:00
Merge 0865c4bfce into cbb722410c
This commit is contained in:
@@ -57,7 +57,12 @@ export async function getInputs(): Promise<IGitSourceSettings> {
|
||||
`${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase()
|
||||
|
||||
// Source branch, source version
|
||||
result.ref = core.getInput('ref')
|
||||
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) {
|
||||
result.ref = github.context.ref
|
||||
|
||||
Reference in New Issue
Block a user