1
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2025-06-07 14:11:48 +02:00

must use || and not ?? when falling back to commit when ref is not provided.

Signed-off-by: James Bradlee <james.bradlee@telenor.no>
This commit is contained in:
James Bradlee 2024-08-20 17:48:27 +02:00
parent 1be0f9404c
commit 0865c4bfce
No known key found for this signature in database
3 changed files with 4 additions and 7 deletions

View file

@ -62,7 +62,7 @@ export async function getInputs(): Promise<IGitSourceSettings> {
throw new Error(`The commit SHA '${result.commit}' is not a valid SHA.`)
}
result.ref = core.getInput('ref') ?? result.commit
result.ref = core.getInput('ref') || result.commit
if (!result.ref) {
if (isWorkflowRepository) {
result.ref = github.context.ref