8000 To spot new files and folders, add --all needed before checking for changes by robtaylor · Pull Request #1875 · JamesIves/github-pages-deploy-action · GitHub
[go: up one dir, main page]

Skip to content

To spot new files and folders, add --all needed before checking for changes #1875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
8000
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions __tests__/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toHaveBeenCalledTimes(12)
expect(execute).toHaveBeenCalledTimes(13)
expect(rmRF).toHaveBeenCalledTimes(1)
})
})
Expand All @@ -352,7 +352,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toHaveBeenCalledTimes(12)
expect(execute).toHaveBeenCalledTimes(13)
expect(rmRF).toHaveBeenCalledTimes(1)
})

Expand All @@ -372,7 +372,7 @@ describe('git', () => {

await deploy(action)

expect(execute).toHaveBeenCalledTimes(12)
expect(execute).toHaveBeenCalledTimes(13)
expect(rmRF).toHaveBeenCalledTimes(1)
expect(mkdirP).toHaveBeenCalledTimes(1)
})
Expand All @@ -392,7 +392,7 @@ describe('git', () => {
})

const response = await deploy(action)
expect(execute).toHaveBeenCalledTimes(12)
expect(execute).toHaveBeenCalledTimes(13)
expect(rmRF).toHaveBeenCalledTimes(1)
expect(response).toBe(Status.SKIPPED)
})
Expand Down
2 changes: 1 addition & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('main', () => {
debug: true
})
await run(action)
expect(execute).toHaveBeenCalledTimes(19)
expect(execute).toHaveBeenCalledTimes(20)
expect(rmRF).toHaveBeenCalledTimes(1)
expect(exportVariable).toHaveBeenCalledTimes(1)
})
Expand Down
13 changes: 7 additions & 6 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ export async function deploy(action: ActionInterface): Promise<Status> {
? `git diff origin/${action.branch}`
: `git status --porcelain`

// Commits to GitHub.
await execute(
`git add --all .`,
`${action.workspace}/${temporaryDeploymentDirectory}`,
action.silent
)

info(`Checking if there are files to commit…`)

const hasFilesToCommit =
Expand All @@ -239,12 +246,6 @@ export async function deploy(action: ActionInterface): Promise<Status> {
return Status.SKIPPED
}

// Commits to GitHub.
await execute(
`git add --all .`,
`${action.workspace}/${temporaryDeploymentDirectory}`,
action.silent
)
await execute(
`git checkout -b ${temporaryDeploymentBranch}`,
`${action.workspace}/${temporaryDeploymentDirectory}`,
Expand Down
0