Skip to content

Commit 0b5c37b

Browse files
committed
[megalinter] exclude examples on deno publish
1 parent ad6b74f commit 0b5c37b

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.github/workflows/megalinter.yml

-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ jobs:
3232
deno-version: v1.41
3333
- name: Publish package
3434
run: |
35-
rm -rf examples
3635
deno publish --allow-slow-types
3736
working-directory: megalinter

megalinter/deno.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,28 @@
1111
},
1212
"fmt": {
1313
"exclude": [
14-
"example/",
14+
"examples/",
1515
".fluentci/",
1616
"gen/"
1717
]
1818
},
1919
"lint": {
2020
"exclude": [
21-
"example/",
21+
"examples/",
2222
".fluentci/",
2323
"gen/"
2424
]
2525
},
2626
"test": {
2727
"exclude": [
28-
"example/",
28+
"examples/",
29+
".fluentci/",
30+
"gen/"
31+
]
32+
},
33+
"publish": {
34+
"exclude": [
35+
"examples/",
2936
".fluentci/",
3037
"gen/"
3138
]

megalinter/src/dagger/jobs.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,25 @@ export const exclude = [];
1818
* @description Lint files.
1919
* @param {string | Directory | undefined} src
2020
* @param {string} version
21+
* @param {string} only
2122
* @returns {Directory | string}
2223
*/
2324
export async function lint(
2425
src: Directory | string,
25-
version: string = "v7"
26+
version: string = "v7",
27+
only?: string
2628
): Promise<Directory | string> {
2729
const context = await getDirectory(src);
30+
let megalinter = `oxsecurity/megalinter:${version}`;
31+
32+
if (only) {
33+
megalinter = `oxsecurity/megalinter-only-${only}:${version}`;
34+
}
35+
2836
const ctr = dag
2937
.pipeline(Job.lint)
3038
.container()
31-
.from(`oxsecurity/megalinter:${version}`)
39+
.from(megalinter)
3240
.withDirectory("/app", context)
3341
.withEnvVariable("DEFAULT_WORKSPACE", "/app")
3442
.withEnvVariable("REPORT_OUTPUT_FOLDER", "/app/megalinter-reports")

0 commit comments

Comments
 (0)