Skip to content

Commit

Permalink
fix: check empty changelog, when empty throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiJingLong committed Jun 12, 2023
1 parent e441695 commit ac6f720
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.2

- Fix: Check empty changelog.

## 2.1.1

- Fix: throw error when changelog is `*None.*`.
Expand Down
10 changes: 9 additions & 1 deletion lib/src/commiter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,20 @@ class PkgCommiter {
newVersion,
);

if (currentVersionChangeLog == noneChangeLogText) {
if (currentVersionChangeLog.toLowerCase() ==
noneChangeLogText.toLowerCase()) {
error(
'No changelog for version $newVersion, current changelog is $currentVersionChangeLog',
);
setFailed('No changelog for version $newVersion');
}

if (currentVersionChangeLog.trim().isEmpty) {
error(
'No changelog for version $newVersion, current changelog is empty',
);
setFailed('No changelog for version $newVersion');
}
}

final commitUser = 'cfug-dev';
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: action_dio_release
description: For release package to github release page and upload to pub.dev.
version: 2.1.1
version: 2.1.2
repository: https://github.com/cfug/dio_issue_release_action
publish_to: none

Expand Down

0 comments on commit ac6f720

Please sign in to comment.