mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Update git.js
This commit is contained in:
parent
4540741d2e
commit
5df73db307
@ -132,8 +132,6 @@ function deploy(action) {
|
||||
yield execute_1.execute(`git commit -m "${commitMessage}" --quiet`, `${action.workspace}/${temporaryDeploymentDirectory}`);
|
||||
yield execute_1.execute(`git push --force ${action.repositoryPath} ${temporaryDeploymentBranch}:${action.branch}`, `${action.workspace}/${temporaryDeploymentDirectory}`);
|
||||
core_1.info(`Changes committed to the ${action.branch} branch… 📦`);
|
||||
// Cleans up temporary files/folders and restores the git state.
|
||||
core_1.info('Running post deployment cleanup jobs…');
|
||||
if (action.singleCommit) {
|
||||
yield execute_1.execute(`git fetch ${action.repositoryPath}`, action.workspace);
|
||||
yield execute_1.execute(`git checkout --orphan ${action.branch}-temp`, `${action.workspace}/${temporaryDeploymentDirectory}`);
|
||||
@ -150,7 +148,8 @@ function deploy(action) {
|
||||
throw new Error(`The deploy step encountered an error: ${util_1.suppressSensitiveInformation(error.message, action)} ❌`);
|
||||
}
|
||||
finally {
|
||||
// Ensures the deployment directory is safely removed after each deployment.
|
||||
// Cleans up temporary files/folders and restores the git state.
|
||||
core_1.info('Running post deployment cleanup jobs… 🗑️');
|
||||
yield execute_1.execute(`git worktree remove ${temporaryDeploymentDirectory}`, action.workspace);
|
||||
yield io_1.rmRF(temporaryDeploymentDirectory);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user