Skip to content

Commit 9bc75d2

Browse files
committed
[megalinter] enable SARIF_REPORTER
[megalinter] log files [megalinter] set REPORT_OUTPUT_FOLDER
1 parent 67a7f64 commit 9bc75d2

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.github/workflows/megalinter.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
uses: fluentci-io/setup-fluentci@v4
1616
- name: Run Dagger Pipelines
1717
run: |
18-
cp -r ../.git .
1918
deno run -A src/dagger/list_jobs.ts
2019
dagger functions
2120
dagger call lint --src examples

megalinter/examples/.mega-linter.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ DISABLE:
2222

2323
SHOW_ELAPSED_TIME: true
2424

25-
FILEIO_REPORTER: true
25+
FILEIO_REPORTER: false
26+
REPORT_OUTPUT_FOLDER: /app/megalinter-reports
27+
ANSIBLE_ANSIBLE_LINT_DIRECTORY: playbooks
2628
# Uncomment if you want MegaLinter to detect errors but not block CI to pass
2729
# DISABLE_ERRORS: true

megalinter/src/dagger/jobs.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,29 @@ export const exclude = [];
1717
* @function
1818
* @description Lint files.
1919
* @param {string | Directory | undefined} src
20+
* @param {string} version
2021
* @returns {Directory | string}
2122
*/
2223
export async function lint(
23-
src: Directory | string
24+
src: Directory | string,
25+
version: string = "v7"
2426
): Promise<Directory | string> {
2527
const context = await getDirectory(src);
2628
const ctr = dag
2729
.pipeline(Job.lint)
2830
.container()
29-
.from("oxsecurity/megalinter:v7")
31+
.from(`oxsecurity/megalinter:${version}`)
3032
.withDirectory("/app", context)
3133
.withEnvVariable("DEFAULT_WORKSPACE", "/app")
32-
.withEnvVariable("REPORT_OUTPUT_FOLDER", "megalinter-reports")
34+
.withEnvVariable("REPORT_OUTPUT_FOLDER", "/app/megalinter-reports")
35+
.withEnvVariable("SARIF_REPORTER", "true")
3336
.withWorkdir("/app");
3437

3538
await ctr.stdout();
36-
return ctr.directory("./megalinter-reports").id();
39+
40+
console.log(await ctr.directory("/app").entries());
41+
42+
return ctr.directory("/app/megalinter-reports").id();
3743
}
3844
export type JobExec = (
3945
src: string,

0 commit comments

Comments
 (0)