Skip to content

Commit 734f59d

Browse files
authored
git: dry-run mode for commit action (#185)
1 parent 587fc3b commit 734f59d

File tree

1 file changed

+6
-0
lines changed
  • tasks/git/src/main/java/com/walmartlabs/concord/plugins/git

1 file changed

+6
-0
lines changed

tasks/git/src/main/java/com/walmartlabs/concord/plugins/git/GitTask.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ private Map<String, Object> doCommit(Map<String, Object> in) throws Exception {
268268

269269
Map<String, Object> commitResult;
270270
log.info("Changes detected in the following files: {}", status.getUncommittedChanges());
271+
272+
if (dryRunMode) {
273+
log.info("Dry-run mode enabled: Skipping real commit");
274+
return Map.of();
275+
}
276+
271277
CommitCommand commitCommand = git.commit()
272278
.setSign(false)
273279
.setAllowEmpty(allowEmptyCommit)

0 commit comments

Comments
 (0)