Single Commit Adjustments

This commit is contained in:
James Ives 2021-08-25 23:16:13 -04:00
parent c1da439fdd
commit 00fe98e4e5
3 changed files with 12 additions and 4 deletions

View File

@ -216,7 +216,7 @@ describe('git', () => {
await deploy(action) await deploy(action)
// Includes the call to generateWorktree // Includes the call to generateWorktree
expect(execute).toBeCalledTimes(11) expect(execute).toBeCalledTimes(12)
expect(rmRF).toBeCalledTimes(1) expect(rmRF).toBeCalledTimes(1)
}) })
@ -240,7 +240,7 @@ describe('git', () => {
await deploy(action) await deploy(action)
// Includes the call to generateWorktree // Includes the call to generateWorktree
expect(execute).toBeCalledTimes(10) expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1) expect(rmRF).toBeCalledTimes(1)
}) })
@ -265,7 +265,7 @@ describe('git', () => {
await deploy(action) await deploy(action)
// Includes the call to generateWorktree // Includes the call to generateWorktree
expect(execute).toBeCalledTimes(10) expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1) expect(rmRF).toBeCalledTimes(1)
}) })

View File

@ -49,7 +49,7 @@ describe('main', () => {
debug: true debug: true
}) })
await run(action) await run(action)
expect(execute).toBeCalledTimes(14) expect(execute).toBeCalledTimes(13)
expect(rmRF).toBeCalledTimes(1) expect(rmRF).toBeCalledTimes(1)
expect(exportVariable).toBeCalledTimes(1) expect(exportVariable).toBeCalledTimes(1)
}) })

View File

@ -143,6 +143,14 @@ export async function deploy(action: ActionInterface): Promise<Status> {
action.silent 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. // Use git status to check if we have something to commit.
// Special case is singleCommit with existing history, when // Special case is singleCommit with existing history, when
// we're really interested if the diff against the upstream branch // we're really interested if the diff against the upstream branch