Skip to content

Commit 63bd035

Browse files
authored
Check no changes (#62)
1 parent f0302a8 commit 63bd035

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ function run() {
7272
core.info(`✍️ Writing ${fqdn} domain name to ${path.join(tmpdir, 'CNAME')}`);
7373
fs.writeFileSync(path.join(tmpdir, 'CNAME'), fqdn.trim());
7474
}
75+
const dirty = child_process.execSync(`git status --short`, { encoding: 'utf8' }).trim().length > 0;
76+
if (keep_history && remote_branch_exists && !dirty) {
77+
core.info('⚠️ There are no changes to commit, stopping.');
78+
return;
79+
}
7580
core.info(`🔨 Configuring git committer to be ${committer_name} <${committer_email}>`);
7681
yield exec.exec('git', ['config', 'user.name', committer_name]);
7782
yield exec.exec('git', ['config', 'user.email', committer_email]);

src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ async function run() {
5959
fs.writeFileSync(path.join(tmpdir, 'CNAME'), fqdn.trim());
6060
}
6161

62+
const dirty = child_process.execSync(`git status --short`, {encoding: 'utf8'}).trim().length > 0;
63+
if (keep_history && remote_branch_exists && !dirty) {
64+
core.info('⚠️ There are no changes to commit, stopping.');
65+
return;
66+
}
67+
6268
core.info(`🔨 Configuring git committer to be ${committer_name} <${committer_email}>`);
6369
await exec.exec('git', ['config', 'user.name', committer_name]);
6470
await exec.exec('git', ['config', 'user.email', committer_email]);

0 commit comments

Comments
 (0)