Skip to content

Commit 5a900ca

Browse files
authored
Only check text files for "do not submit" string (#243)
* Only check text files for do not submit string * Rev version
1 parent 49a3cbb commit 5a900ca

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

pkgs/firehose/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.8.0
2+
3+
- Only check text files for do not submit strings.
4+
15
## 0.7.0
26

37
- Add `ignore-packages` flag to the publish workflow.

pkgs/firehose/lib/src/health/health.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,17 @@ Changes to files need to be [accounted for](https://github.com/dart-lang/ecosyst
306306

307307
Future<HealthCheckResult> doNotSubmitCheck() async {
308308
final dns = 'DO_NOT${'_'}SUBMIT';
309+
// To avoid trying to read non-text files.
310+
const supportedExtensions = ['.dart', '.json', '.md', '.txt'];
309311

310312
final body = await github.pullrequestBody();
311313
final files = await github.listFilesForPR(directory, ignoredPackages);
312314
print('Checking for DO_NOT${'_'}SUBMIT strings: $files');
313315
final filesWithDNS = files
314316
.where((file) =>
315317
![FileStatus.removed, FileStatus.unchanged].contains(file.status))
318+
.where((file) =>
319+
supportedExtensions.contains(path.extension(file.filename)))
316320
.where((file) => File(file.pathInRepository)
317321
.readAsStringSync()
318322
.contains('DO_NOT${'_'}SUBMIT'))

pkgs/firehose/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: firehose
22
description: A tool to automate publishing of Pub packages from GitHub actions.
3-
version: 0.7.0
3+
version: 0.8.0
44
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose
55

66
environment:

pkgs/firehose/test/health_test.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Future<void> main() async {
2525
FileStatus.added,
2626
directory,
2727
),
28+
GitFile(
29+
'pkgs/package2/someImage.png',
30+
FileStatus.added,
31+
directory,
32+
),
2833
]);
2934
await Process.run('dart', ['pub', 'global', 'activate', 'dart_apitool']);
3035
await Process.run('dart', ['pub', 'global', 'activate', 'coverage']);
Loading

0 commit comments

Comments
 (0)