Skip to content

Commit ca268ad

Browse files
committed
ci(frontend): add npm audit workflow
- Create 'frontend-audit.yaml' to fail on high-severity vulnerabilities - Integrate audit job into main 'frontend-ci.yaml' Signed-off-by: Davide Briani <davide.briani@secomind.com>
1 parent edd6bd8 commit ca268ad

6 files changed

Lines changed: 1248 additions & 1549 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file is part of Edgehog.
2+
#
3+
# Copyright 2026 SECO Mind Srl
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# SPDX-License-Identifier: Apache-2.0
18+
19+
name: NPM Audit
20+
on:
21+
workflow_call:
22+
workflow_dispatch:
23+
permissions:
24+
contents: read
25+
defaults:
26+
run:
27+
shell: bash
28+
working-directory: frontend
29+
jobs:
30+
audit:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v6
34+
with:
35+
show-progress: false
36+
- uses: actions/setup-node@v6
37+
id: cache-npm
38+
with:
39+
node-version-file: .tool-versions
40+
cache: "npm"
41+
cache-dependency-path: frontend/package-lock.json
42+
- name: npm install
43+
run: npm ci --ignore-scripts
44+
- name: npm audit
45+
run: npm audit --audit-level=high

.github/workflows/frontend-ci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Edgehog.
33
#
4-
# Copyright 2021 - 2025 SECO Mind Srl
4+
# Copyright 2021 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -62,3 +62,6 @@ jobs:
6262
coverage:
6363
needs: [warmup-cache]
6464
uses: ./.github/workflows/frontend-coverage.yaml
65+
audit:
66+
needs: [warmup-cache]
67+
uses: ./.github/workflows/frontend-audit.yaml

0 commit comments

Comments
 (0)