Skip to content

Commit 6b62ae2

Browse files
committed
ci: Add override for lit analzyer
1 parent 2dd29ed commit 6b62ae2

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,5 @@ export default {
104104
| coverage-pass-score | The minimum coverage score required to pass | false | "80" |
105105
| eslint-config-path | The path to the ESLint configuration file | false | "eslint.config.\*" |
106106
| test-config-path | The path to the test configuration file | false | "web-test-runner.config.\*" |
107-
| eslint-cmd | The command used for eslint | false | "npx eslint -f unix $web-components-src --config $eslint-config-path" |
107+
| eslint-cmd | Override command used for eslint | false | "npx eslint -f unix $web-components-src --config $eslint-config-path" |
108+
| lit-analyzer-cmd | Override command used for lit analyzer | false | npx lit-analyzer --quiet --format markdown |

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ inputs:
8484
description: "The command to run ESLint"
8585
required: false
8686
default: ""
87+
88+
lit-analyzer-cmd:
89+
description: "The command to run lit analyzer"
90+
required: false
91+
default: ""
92+
8793
runs:
8894
using: node20
8995
main: dist/index.js

dist/index.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ const getInputs = (
205205
string,
206206
string,
207207
string,
208+
string,
208209
] => {
209210
// get the token and octokit
210211
let token = "";
@@ -266,6 +267,8 @@ const getInputs = (
266267

267268
const esLintCmd: string = isLocal ? "" : getInput("eslint-cmd");
268269

270+
const litAnalyzerCmd: string = isLocal ? "" : getInput("lit-analyzer-cmd");
271+
269272
return [
270273
token,
271274
workingDirectory,
@@ -282,6 +285,7 @@ const getInputs = (
282285
eslintConfigPath,
283286
testConfigPath,
284287
esLintCmd,
288+
litAnalyzerCmd,
285289
];
286290
};
287291

@@ -327,6 +331,7 @@ export async function run(): Promise<void> {
327331
eslintConfigPath,
328332
testConfigPath,
329333
esLintCmd,
334+
litAnalyzerCmd,
330335
] = getInputs(isLocal);
331336

332337
// Check if the working directory is different from the current directory
@@ -356,7 +361,9 @@ export async function run(): Promise<void> {
356361
const litAnalyzerStr: StepResponse | undefined = doStaticAnalysis
357362
? await litAnalyzer({
358363
label: "Lit Analyzer",
359-
command: "npx lit-analyzer --quiet --format markdown",
364+
command: litAnalyzerCmd.isEmpty()
365+
? "npx lit-analyzer --quiet --format markdown"
366+
: litAnalyzerCmd,
360367
})
361368
: undefined;
362369

0 commit comments

Comments
 (0)