Skip to content

Commit 98a52c7

Browse files
committed
This commit should fail
1 parent d829476 commit 98a52c7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/pr_commits.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
run: dart pub get
1515

1616
- name: Validate PR Commits
17-
run: dart run commitlint_cli --from="${{ github.base_ref }}" --to="${{ github.head_ref }}" --config lib/commitlint.yaml
17+
run: VERBOSE=true dart run commitlint_cli --from="origin/${{ github.base_ref }}" --to="origin/${{ github.head_ref }}" --config lib/commitlint.yaml

lib/src/read.dart

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import 'dart:io';
22
import 'package:path/path.dart';
3+
import 'package:verbose/verbose.dart';
4+
5+
final verbose = Verbose('commitlint:read');
36

47
/// Read commit messages in given range([from], [to]),
58
/// or in [edit] file.
@@ -11,6 +14,7 @@ Future<Iterable<String>> read({
1114
String? workingDirectory,
1215
Iterable<String>? gitLogArgs,
1316
}) async {
17+
verbose('from = $from, to = $to, edit = $edit');
1418
if (edit != null) {
1519
return await _getEditingCommit(
1620
edit: edit, workingDirectory: workingDirectory);
@@ -26,11 +30,14 @@ Future<Iterable<String>> _getRangeCommits({
2630
required Iterable<String> gitLogArgs,
2731
String? workingDirectory,
2832
}) async {
33+
verbose('git log ${gitLogArgs.join(' ')}');
2934
final result = await Process.run(
3035
'git',
3136
['log', ...gitLogArgs],
3237
workingDirectory: workingDirectory,
3338
);
39+
verbose('stdout = ${result.stdout}');
40+
verbose('stderr = ${result.stderr}');
3441
return ((result.stdout as String).trim().split('\n'))
3542
.where((message) => message.trim().isNotEmpty)
3643
.toList();
@@ -40,11 +47,14 @@ Future<Iterable<String>> _getEditingCommit({
4047
required String edit,
4148
String? workingDirectory,
4249
}) async {
50+
verbose('git rev-parse --show-toplevel');
4351
final result = await Process.run(
4452
'git',
4553
['rev-parse', '--show-toplevel'],
4654
workingDirectory: workingDirectory,
4755
);
56+
verbose('stdout = ${result.stdout}');
57+
verbose('stderr = ${result.stderr}');
4858
final root = result.stdout.toString().trim();
4959
final file = File(join(root, edit));
5060
if (await file.exists()) {

0 commit comments

Comments
 (0)