1
0
mirror of https://github.com/actions/checkout.git synced 2026-06-14 16:53:47 +08:00
This commit is contained in:
James Bradlee
2026-01-10 10:33:14 +07:00
committed by GitHub
5 changed files with 47 additions and 2 deletions

6
dist/index.js vendored
View File

@@ -2008,7 +2008,11 @@ function getInputs() {
const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
`${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;