Skip to content

Commit 9ba99b8

Browse files
authored
Fix MegaLinter build issue (#2539)
* Add comments in npm install instructions * [MegaLinter] Apply linters fixes * Deactivate npm audit fix * [MegaLinter] Apply linters fixes * Build * Typo * trvy --------- Co-authored-by: nvuillam <[email protected]>
1 parent 00df56b commit 9ba99b8

File tree

52 files changed

+156
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+156
-51
lines changed

.automation/build.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,13 @@ def build_dockerfile(
473473
+ "RUN npm --no-cache install --ignore-scripts --omit=dev \\\n "
474474
+ " \\\n ".join(list(dict.fromkeys(npm_packages)))
475475
+ " && \\\n"
476-
+ " npm audit fix --audit-level=critical || true \\\n"
476+
# + ' echo "Fixing audit issues with npm..." \\\n'
477+
# + " && npm audit fix --audit-level=critical || true \\\n" # Deactivated for now
478+
+ ' echo "Cleaning npm cache..." \\\n'
477479
+ " && npm cache clean --force || true \\\n"
480+
+ ' && echo "Changing owner of node_modules files..." \\\n'
478481
+ ' && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \\\n'
482+
+ ' && echo "Removing extra node_module files..." \\\n'
479483
+ " && rm -rf /root/.npm/_cacache \\\n"
480484
+ ' && find . -name "*.d.ts" -delete \\\n'
481485
+ ' && find . -name "*.map" -delete \\\n'

.trivyignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ CVE-2022-42889
157157
CVE-2022-43680
158158
CVE-2022-46175
159159
CVE-2023-0286
160+
CVE-2023-29017
160161
DS001
161162
DS002
162163
DS003

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,11 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
241241
prettyjson \
242242
@typescript-eslint/eslint-plugin \
243243
@typescript-eslint/parser && \
244-
npm audit fix --audit-level=critical || true \
244+
echo "Cleaning npm cache..." \
245245
&& npm cache clean --force || true \
246+
&& echo "Changing owner of node_modules files..." \
246247
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
248+
&& echo "Removing extra node_module files..." \
247249
&& rm -rf /root/.npm/_cacache \
248250
&& find . -name "*.d.ts" -delete \
249251
&& find . -name "*.map" -delete \

flavors/ci_light/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
115115
secretlint \
116116
@secretlint/secretlint-rule-preset-recommend \
117117
@secretlint/secretlint-formatter-sarif && \
118-
npm audit fix --audit-level=critical || true \
118+
echo "Cleaning npm cache..." \
119119
&& npm cache clean --force || true \
120+
&& echo "Changing owner of node_modules files..." \
120121
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
122+
&& echo "Removing extra node_module files..." \
121123
&& rm -rf /root/.npm/_cacache \
122124
&& find . -name "*.d.ts" -delete \
123125
&& find . -name "*.map" -delete \

flavors/cupcake/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,11 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
201201
prettyjson \
202202
@typescript-eslint/eslint-plugin \
203203
@typescript-eslint/parser && \
204-
npm audit fix --audit-level=critical || true \
204+
echo "Cleaning npm cache..." \
205205
&& npm cache clean --force || true \
206+
&& echo "Changing owner of node_modules files..." \
206207
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
208+
&& echo "Removing extra node_module files..." \
207209
&& rm -rf /root/.npm/_cacache \
208210
&& find . -name "*.d.ts" -delete \
209211
&& find . -name "*.map" -delete \

flavors/documentation/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
146146
cspell \
147147
sql-lint \
148148
tekton-lint && \
149-
npm audit fix --audit-level=critical || true \
149+
echo "Cleaning npm cache..." \
150150
&& npm cache clean --force || true \
151+
&& echo "Changing owner of node_modules files..." \
151152
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
153+
&& echo "Removing extra node_module files..." \
152154
&& rm -rf /root/.npm/_cacache \
153155
&& find . -name "*.d.ts" -delete \
154156
&& find . -name "*.map" -delete \

flavors/dotnet/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
166166
cspell \
167167
sql-lint \
168168
tekton-lint && \
169-
npm audit fix --audit-level=critical || true \
169+
echo "Cleaning npm cache..." \
170170
&& npm cache clean --force || true \
171+
&& echo "Changing owner of node_modules files..." \
171172
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
173+
&& echo "Removing extra node_module files..." \
172174
&& rm -rf /root/.npm/_cacache \
173175
&& find . -name "*.d.ts" -delete \
174176
&& find . -name "*.map" -delete \

flavors/go/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
153153
cspell \
154154
sql-lint \
155155
tekton-lint && \
156-
npm audit fix --audit-level=critical || true \
156+
echo "Cleaning npm cache..." \
157157
&& npm cache clean --force || true \
158+
&& echo "Changing owner of node_modules files..." \
158159
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
160+
&& echo "Removing extra node_module files..." \
159161
&& rm -rf /root/.npm/_cacache \
160162
&& find . -name "*.d.ts" -delete \
161163
&& find . -name "*.map" -delete \

flavors/java/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
146146
cspell \
147147
sql-lint \
148148
tekton-lint && \
149-
npm audit fix --audit-level=critical || true \
149+
echo "Cleaning npm cache..." \
150150
&& npm cache clean --force || true \
151+
&& echo "Changing owner of node_modules files..." \
151152
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
153+
&& echo "Removing extra node_module files..." \
152154
&& rm -rf /root/.npm/_cacache \
153155
&& find . -name "*.d.ts" -delete \
154156
&& find . -name "*.map" -delete \

flavors/javascript/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
166166
prettyjson \
167167
@typescript-eslint/eslint-plugin \
168168
@typescript-eslint/parser && \
169-
npm audit fix --audit-level=critical || true \
169+
echo "Cleaning npm cache..." \
170170
&& npm cache clean --force || true \
171+
&& echo "Changing owner of node_modules files..." \
171172
&& chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \
173+
&& echo "Removing extra node_module files..." \
172174
&& rm -rf /root/.npm/_cacache \
173175
&& find . -name "*.d.ts" -delete \
174176
&& find . -name "*.map" -delete \

0 commit comments

Comments
 (0)