diff --git a/pkgs/firehose/CHANGELOG.md b/pkgs/firehose/CHANGELOG.md index d8da3b02..9711bd9c 100644 --- a/pkgs/firehose/CHANGELOG.md +++ b/pkgs/firehose/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.0 + +- Only check text files for do not submit strings. + ## 0.7.0 - Add `ignore-packages` flag to the publish workflow. diff --git a/pkgs/firehose/lib/src/health/health.dart b/pkgs/firehose/lib/src/health/health.dart index 264f3589..dc9343d6 100644 --- a/pkgs/firehose/lib/src/health/health.dart +++ b/pkgs/firehose/lib/src/health/health.dart @@ -306,6 +306,8 @@ Changes to files need to be [accounted for](https://github.com/dart-lang/ecosyst Future doNotSubmitCheck() async { final dns = 'DO_NOT${'_'}SUBMIT'; + // To avoid trying to read non-text files. + const supportedExtensions = ['.dart', '.json', '.md', '.txt']; final body = await github.pullrequestBody(); final files = await github.listFilesForPR(directory, ignoredPackages); @@ -313,6 +315,8 @@ Changes to files need to be [accounted for](https://github.com/dart-lang/ecosyst final filesWithDNS = files .where((file) => ![FileStatus.removed, FileStatus.unchanged].contains(file.status)) + .where((file) => + supportedExtensions.contains(path.extension(file.filename))) .where((file) => File(file.pathInRepository) .readAsStringSync() .contains('DO_NOT${'_'}SUBMIT')) diff --git a/pkgs/firehose/pubspec.yaml b/pkgs/firehose/pubspec.yaml index baacac6c..89be06a4 100644 --- a/pkgs/firehose/pubspec.yaml +++ b/pkgs/firehose/pubspec.yaml @@ -1,6 +1,6 @@ name: firehose description: A tool to automate publishing of Pub packages from GitHub actions. -version: 0.7.0 +version: 0.8.0 repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose environment: diff --git a/pkgs/firehose/test/health_test.dart b/pkgs/firehose/test/health_test.dart index 33025f66..41f408ec 100644 --- a/pkgs/firehose/test/health_test.dart +++ b/pkgs/firehose/test/health_test.dart @@ -25,6 +25,11 @@ Future main() async { FileStatus.added, directory, ), + GitFile( + 'pkgs/package2/someImage.png', + FileStatus.added, + directory, + ), ]); await Process.run('dart', ['pub', 'global', 'activate', 'dart_apitool']); await Process.run('dart', ['pub', 'global', 'activate', 'coverage']); diff --git a/pkgs/firehose/test_data/test_repo/pkgs/package2/someImage.png b/pkgs/firehose/test_data/test_repo/pkgs/package2/someImage.png new file mode 100644 index 00000000..7f81c472 Binary files /dev/null and b/pkgs/firehose/test_data/test_repo/pkgs/package2/someImage.png differ