Skip to content

Commit 219e8a3

Browse files
authored
fix: Do not error on --validate or --dry-run when no release will be created for PrepareRelease. (#265)
Closes #263 Co-authored-by: Dylan Anthony <[email protected]>
1 parent e5f40d8 commit 219e8a3

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/releases/conventional_commits.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,13 @@ pub(crate) fn update_project_from_conventional_commits(
351351
state.releases.push(state::Release::Prepared(release));
352352
}
353353
}
354-
if state.releases.is_empty() {
355-
return Err(StepError::NoRelease);
356-
}
357354
if let Some(dry_run_stdout) = dry_run_stdout {
358355
Ok(RunType::DryRun {
359356
state,
360357
stdout: dry_run_stdout,
361358
})
359+
} else if state.releases.is_empty() {
360+
Err(StepError::NoRelease)
362361
} else {
363362
Ok(RunType::Real(state))
364363
}

tests/prepare_release.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ fn no_version_change() {
12041204

12051205
// Assert.
12061206
dry_run_output
1207-
.failure()
1207+
.success()
12081208
.stderr_eq_path(source_path.join("dry_run_output.txt"));
12091209
actual_assert
12101210
.failure()
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
Error:
2-
× Problem with workflow release
3-
4-
Error: step::no_release (https://knope-dev.github.io/knope/config/step/PrepareRelease.html)
5-
6-
× No packages are ready to release
7-
help: The `PrepareRelease` step will not complete if no commits cause a
8-
package's version to be increased.
9-

0 commit comments

Comments
 (0)