mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Skips deployment if the working tree is clean (#55)
* Adding procelain * Update git.ts
This commit is contained in:
parent
7a65168f11
commit
0dfa1cb46b
@ -102,6 +102,11 @@ function deploy() {
|
||||
force: true
|
||||
});
|
||||
}
|
||||
const hasFilesToCommit = yield util_1.execute(`git status --porcelain`, temporaryDeploymentDirectory);
|
||||
if (!hasFilesToCommit) {
|
||||
console.log('There is nothing to commit. Exiting...');
|
||||
return Promise.resolve();
|
||||
}
|
||||
// Commits to GitHub.
|
||||
yield util_1.execute(`git add --all .`, temporaryDeploymentDirectory);
|
||||
yield util_1.execute(`git switch -c ${temporaryDeploymentBranch}`, temporaryDeploymentDirectory);
|
||||
|
10
src/git.ts
10
src/git.ts
@ -99,6 +99,16 @@ export async function deploy(): Promise<any> {
|
||||
});
|
||||
}
|
||||
|
||||
const hasFilesToCommit = await execute(
|
||||
`git status --porcelain`,
|
||||
temporaryDeploymentDirectory
|
||||
);
|
||||
|
||||
if (!hasFilesToCommit) {
|
||||
console.log("There is nothing to commit. Exiting...");
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
// Commits to GitHub.
|
||||
await execute(`git add --all .`, temporaryDeploymentDirectory);
|
||||
await execute(
|
||||
|
Loading…
Reference in New Issue
Block a user