Check no changes (#62)

This commit is contained in:
CrazyMax 2020-02-11 13:38:54 +01:00 committed by GitHub
parent f0302a8394
commit 63bd035710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -72,6 +72,11 @@ function run() {
core.info(`✍️ Writing ${fqdn} domain name to ${path.join(tmpdir, 'CNAME')}`);
fs.writeFileSync(path.join(tmpdir, 'CNAME'), fqdn.trim());
}
const dirty = child_process.execSync(`git status --short`, { encoding: 'utf8' }).trim().length > 0;
if (keep_history && remote_branch_exists && !dirty) {
core.info('⚠️ There are no changes to commit, stopping.');
return;
}
core.info(`🔨 Configuring git committer to be ${committer_name} <${committer_email}>`);
yield exec.exec('git', ['config', 'user.name', committer_name]);
yield exec.exec('git', ['config', 'user.email', committer_email]);

View File

@ -59,6 +59,12 @@ async function run() {
fs.writeFileSync(path.join(tmpdir, 'CNAME'), fqdn.trim());
}
const dirty = child_process.execSync(`git status --short`, {encoding: 'utf8'}).trim().length > 0;
if (keep_history && remote_branch_exists && !dirty) {
core.info('⚠️ There are no changes to commit, stopping.');
return;
}
core.info(`🔨 Configuring git committer to be ${committer_name} <${committer_email}>`);
await exec.exec('git', ['config', 'user.name', committer_name]);
await exec.exec('git', ['config', 'user.email', committer_email]);