Skip to content

Commit d27d87d

Browse files
hyobanfengmk2
andauthored
fix: failed to check inside github action (#914)
Fixes voidzero-dev/setup-vp#7 I'm unsure whether we can produce good terminal output while retaining the GitHub reporter. If my fix is off course, please feel free to close this PR. Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
1 parent d4381ae commit d27d87d

6 files changed

Lines changed: 34 additions & 0 deletions

File tree

packages/cli/binding/src/cli.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,12 @@ async fn execute_direct_subcommand(
11091109
if fix {
11101110
args.push("--fix".to_string());
11111111
}
1112+
// `vp check` parses oxlint's human-readable summary output to print
1113+
// unified pass/fail lines. When `GITHUB_ACTIONS=true`, oxlint auto-switches
1114+
// to the GitHub reporter, which omits that summary on success and makes the
1115+
// parser think linting never started. Force the default reporter here so the
1116+
// captured output is stable across local and CI environments.
1117+
args.push("--format=default".to_string());
11121118
if has_paths {
11131119
args.extend(paths.iter().cloned());
11141120
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "check-pass-typecheck-github-actions",
3+
"version": "0.0.0",
4+
"private": true
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> vp check
2+
pass: All 4 files are correctly formatted (<variable>ms, <variable> threads)
3+
pass: Found no warnings, lint errors, or type errors in 2 files (<variable>ms, <variable> threads)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function hello() {
2+
return "hello";
3+
}
4+
5+
export { hello };
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"env": {
3+
"GITHUB_ACTIONS": "true",
4+
"VITE_DISABLE_AUTO_INSTALL": "1"
5+
},
6+
"commands": ["vp check"]
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
lint: {
3+
options: {
4+
typeAware: true,
5+
typeCheck: true,
6+
},
7+
},
8+
};

0 commit comments

Comments
 (0)