mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Merge branch 'dev' into releases/v3
This commit is contained in:
commit
b61b2aadf4
@ -341,7 +341,7 @@ describe('git', () => {
|
|||||||
const response = await deploy(action)
|
const response = await deploy(action)
|
||||||
|
|
||||||
// Includes the call to generateBranch
|
// Includes the call to generateBranch
|
||||||
expect(execute).toBeCalledTimes(13)
|
expect(execute).toBeCalledTimes(12)
|
||||||
expect(rmRF).toBeCalledTimes(1)
|
expect(rmRF).toBeCalledTimes(1)
|
||||||
expect(response).toBe(Status.SUCCESS)
|
expect(response).toBe(Status.SUCCESS)
|
||||||
})
|
})
|
||||||
@ -361,7 +361,7 @@ describe('git', () => {
|
|||||||
await deploy(action)
|
await deploy(action)
|
||||||
|
|
||||||
// Includes the call to generateBranch
|
// Includes the call to generateBranch
|
||||||
expect(execute).toBeCalledTimes(19)
|
expect(execute).toBeCalledTimes(18)
|
||||||
expect(rmRF).toBeCalledTimes(1)
|
expect(rmRF).toBeCalledTimes(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -382,7 +382,7 @@ describe('git', () => {
|
|||||||
await deploy(action)
|
await deploy(action)
|
||||||
|
|
||||||
// Includes the call to generateBranch
|
// Includes the call to generateBranch
|
||||||
expect(execute).toBeCalledTimes(13)
|
expect(execute).toBeCalledTimes(12)
|
||||||
expect(rmRF).toBeCalledTimes(1)
|
expect(rmRF).toBeCalledTimes(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -402,7 +402,7 @@ describe('git', () => {
|
|||||||
await deploy(action)
|
await deploy(action)
|
||||||
|
|
||||||
// Includes the call to generateBranch
|
// Includes the call to generateBranch
|
||||||
expect(execute).toBeCalledTimes(13)
|
expect(execute).toBeCalledTimes(12)
|
||||||
expect(rmRF).toBeCalledTimes(1)
|
expect(rmRF).toBeCalledTimes(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -421,7 +421,7 @@ describe('git', () => {
|
|||||||
|
|
||||||
await deploy(action)
|
await deploy(action)
|
||||||
|
|
||||||
expect(execute).toBeCalledTimes(13)
|
expect(execute).toBeCalledTimes(12)
|
||||||
expect(rmRF).toBeCalledTimes(1)
|
expect(rmRF).toBeCalledTimes(1)
|
||||||
expect(mkdirP).toBeCalledTimes(1)
|
expect(mkdirP).toBeCalledTimes(1)
|
||||||
})
|
})
|
||||||
|
@ -64,7 +64,7 @@ describe('main', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
await run(action)
|
await run(action)
|
||||||
expect(execute).toBeCalledTimes(19)
|
expect(execute).toBeCalledTimes(18)
|
||||||
expect(rmRF).toBeCalledTimes(1)
|
expect(rmRF).toBeCalledTimes(1)
|
||||||
expect(exportVariable).toBeCalledTimes(1)
|
expect(exportVariable).toBeCalledTimes(1)
|
||||||
})
|
})
|
||||||
|
@ -67,8 +67,9 @@ export const action: ActionInterface = {
|
|||||||
? getInput('GIT_CONFIG_EMAIL')
|
? getInput('GIT_CONFIG_EMAIL')
|
||||||
: pusher && pusher.email
|
: pusher && pusher.email
|
||||||
? pusher.email
|
? pusher.email
|
||||||
: `${process.env.GITHUB_ACTOR ||
|
: `${
|
||||||
'github-pages-deploy-action'}@users.noreply.github.com`,
|
process.env.GITHUB_ACTOR || 'github-pages-deploy-action'
|
||||||
|
}@users.noreply.github.com`,
|
||||||
gitHubToken: getInput('GITHUB_TOKEN'),
|
gitHubToken: getInput('GITHUB_TOKEN'),
|
||||||
name: !isNullOrUndefined(getInput('GIT_CONFIG_NAME'))
|
name: !isNullOrUndefined(getInput('GIT_CONFIG_NAME'))
|
||||||
? getInput('GIT_CONFIG_NAME')
|
? getInput('GIT_CONFIG_NAME')
|
||||||
|
@ -233,11 +233,6 @@ export async function deploy(action: ActionInterface): Promise<Status> {
|
|||||||
action.workspace
|
action.workspace
|
||||||
)
|
)
|
||||||
|
|
||||||
await execute(
|
|
||||||
`git branch -D ${temporaryDeploymentBranch}`,
|
|
||||||
action.workspace
|
|
||||||
)
|
|
||||||
|
|
||||||
return Status.SUCCESS
|
return Status.SUCCESS
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
@ -33,9 +33,9 @@ export default async function run(
|
|||||||
info(
|
info(
|
||||||
`${
|
`${
|
||||||
status === Status.FAILED
|
status === Status.FAILED
|
||||||
? 'Deployment Failed ❌'
|
? 'Deployment failed! ❌'
|
||||||
: status === Status.SUCCESS
|
: status === Status.SUCCESS
|
||||||
? 'Completed Deployment Successfully! ✅'
|
? 'Completed deployment successfully! ✅'
|
||||||
: 'There is nothing to commit. Exiting early… 📭'
|
: 'There is nothing to commit. Exiting early… 📭'
|
||||||
}`
|
}`
|
||||||
)
|
)
|
||||||
|
@ -19,10 +19,9 @@ export const generateTokenType = (action: ActionInterface): string =>
|
|||||||
export const generateRepositoryPath = (action: ActionInterface): string =>
|
export const generateRepositoryPath = (action: ActionInterface): string =>
|
||||||
action.ssh
|
action.ssh
|
||||||
? `git@github.com:${action.repositoryName}`
|
? `git@github.com:${action.repositoryName}`
|
||||||
: `https://${action.accessToken ||
|
: `https://${
|
||||||
`x-access-token:${action.gitHubToken}`}@github.com/${
|
action.accessToken || `x-access-token:${action.gitHubToken}`
|
||||||
action.repositoryName
|
}@github.com/${action.repositoryName}.git`
|
||||||
}.git`
|
|
||||||
|
|
||||||
/* Checks for the required tokens and formatting. Throws an error if any case is matched. */
|
/* Checks for the required tokens and formatting. Throws an error if any case is matched. */
|
||||||
export const hasRequiredParameters = (action: ActionInterface): void => {
|
export const hasRequiredParameters = (action: ActionInterface): void => {
|
||||||
|
Loading…
Reference in New Issue
Block a user