Skip to content

Commit 6482560

Browse files
committed
[megalinter] set REPORT_OUTPUT_FOLDER
[megalinter] set REPORT_OUTPUT_FOLDER [megalinter] enable SARIF_REPORTER [megalinter] log files [megalinter] set REPORT_OUTPUT_FOLDER [megalinter] set REPORT_OUTPUT_FOLDER [megalinter] set REPORT_OUTPUT_FOLDER
1 parent fae4633 commit 6482560

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
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

+12-3
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,30 @@ 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-
.withWorkdir("/app");
34+
.withEnvVariable("REPORT_OUTPUT_FOLDER", "/app/megalinter-reports")
35+
.withWorkdir("/app")
36+
.withoutEntrypoint()
37+
.withExec(["/entrypoint.sh"])
38+
.withExec(["ls", "-la", "/app"]);
3339

3440
await ctr.stdout();
41+
42+
console.log(await ctr.directory("/app").entries());
43+
3544
return ctr.directory("/app/megalinter-reports").id();
3645
}
3746
export type JobExec = (

0 commit comments

Comments
 (0)