diff --git a/__tests__/git.test.ts b/__tests__/git.test.ts index 1f04fa61..44da5e4d 100644 --- a/__tests__/git.test.ts +++ b/__tests__/git.test.ts @@ -216,7 +216,7 @@ describe('git', () => { await deploy(action) // Includes the call to generateWorktree - expect(execute).toBeCalledTimes(11) + expect(execute).toBeCalledTimes(12) expect(rmRF).toBeCalledTimes(1) }) @@ -240,7 +240,7 @@ describe('git', () => { await deploy(action) // Includes the call to generateWorktree - expect(execute).toBeCalledTimes(10) + expect(execute).toBeCalledTimes(11) expect(rmRF).toBeCalledTimes(1) }) @@ -265,7 +265,7 @@ describe('git', () => { await deploy(action) // Includes the call to generateWorktree - expect(execute).toBeCalledTimes(10) + expect(execute).toBeCalledTimes(11) expect(rmRF).toBeCalledTimes(1) }) diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 82dfee9e..6ff9cbf6 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -49,7 +49,7 @@ describe('main', () => { debug: true }) await run(action) - expect(execute).toBeCalledTimes(14) + expect(execute).toBeCalledTimes(13) expect(rmRF).toBeCalledTimes(1) expect(exportVariable).toBeCalledTimes(1) }) diff --git a/src/git.ts b/src/git.ts index ed072aba..4d733aa4 100644 --- a/src/git.ts +++ b/src/git.ts @@ -143,6 +143,14 @@ export async function deploy(action: ActionInterface): Promise { action.silent ) + if (action.singleCommit) { + await execute( + `git add --all .`, + `${action.workspace}/${temporaryDeploymentDirectory}`, + action.silent + ) + } + // Use git status to check if we have something to commit. // Special case is singleCommit with existing history, when // we're really interested if the diff against the upstream branch