3
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2024-11-25 12:29:31 +01:00

Add a test

This commit is contained in:
alexanderkranga 2024-02-19 19:28:53 +02:00
parent 47b9382799
commit 6b8be4cb30
3 changed files with 3 additions and 2 deletions

View file

@ -80,6 +80,7 @@ describe('input-helper tests', () => {
expect(settings.commit).toBeTruthy() expect(settings.commit).toBeTruthy()
expect(settings.commit).toBe('1234567890123456789012345678901234567890') expect(settings.commit).toBe('1234567890123456789012345678901234567890')
expect(settings.filter).toBe(undefined) expect(settings.filter).toBe(undefined)
expect(settings.defaultBranchCheckout).toBe(false)
expect(settings.sparseCheckout).toBe(undefined) expect(settings.sparseCheckout).toBe(undefined)
expect(settings.sparseCheckoutConeMode).toBe(true) expect(settings.sparseCheckoutConeMode).toBe(true)
expect(settings.fetchDepth).toBe(1) expect(settings.fetchDepth).toBe(1)

2
dist/index.js vendored
View file

@ -1741,7 +1741,7 @@ function getInputs() {
core.debug(`commit = '${result.commit}'`); core.debug(`commit = '${result.commit}'`);
// Default branch checkout // Default branch checkout
result.defaultBranchCheckout = result.defaultBranchCheckout =
(core.getInput('default-branch-checkout') || 'true').toUpperCase() === (core.getInput('default-branch-checkout') || 'false').toUpperCase() ===
'TRUE'; 'TRUE';
core.debug(`default-branch-checkout = '${result.defaultBranchCheckout}'`); core.debug(`default-branch-checkout = '${result.defaultBranchCheckout}'`);
// Clean // Clean

View file

@ -80,7 +80,7 @@ export async function getInputs(): Promise<IGitSourceSettings> {
// Default branch checkout // Default branch checkout
result.defaultBranchCheckout = result.defaultBranchCheckout =
(core.getInput('default-branch-checkout') || 'true').toUpperCase() === (core.getInput('default-branch-checkout') || 'false').toUpperCase() ===
'TRUE' 'TRUE'
core.debug(`default-branch-checkout = '${result.defaultBranchCheckout}'`) core.debug(`default-branch-checkout = '${result.defaultBranchCheckout}'`)