Skip to content

Commit 9dcf388

Browse files
committed
ci(workspace): edit pnpm audit workflow to scan dependencies
Follow the current style of configuring CI jobs as requested by reviewers: - Use matrix strategy for Node.js versions for ease of maintenance - Match the exact same style as reference pr-builder.yml workflow Addresses reviewer feedback: "Lets follow the current style of configuring CI jobs. We usually keep a matrix of the versions such as Node.js for ease."
1 parent b5b00bc commit 9dcf388

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

.github/workflows/npm-audit.yml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -------------------------------------------------------------------------------------
22
#
3-
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
3+
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
44
#
55
# WSO2 LLC. licenses this file to you under the Apache License,
66
# Version 2.0 (the "License"); you may not use this file except
@@ -20,39 +20,42 @@
2020

2121
# This workflow will perform a security audit on the codebase.
2222

23-
name: Security Audit
23+
name: 🛡️ Security Audit
2424

2525
on:
2626
pull_request:
27-
branches: [ main ]
27+
branches: [main]
28+
workflow_dispatch:
2829

2930
jobs:
3031
audit:
32+
name: 🛡️ Security Audit
3133
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
node-version: [lts/*]
3237
steps:
33-
- name: Checkout code
34-
uses: actions/checkout@v4
38+
- name: ⬇️ Checkout
39+
id: checkout
40+
uses: actions/[email protected]
3541

36-
- name: Setup Node.js
37-
uses: actions/setup-node@v4
42+
- name: 🟢 Setup node
43+
id: setup-node
44+
uses: actions/setup-node@v2
3845
with:
39-
node-version: 18
46+
node-version: ${{ matrix.node-version }}
4047

41-
- name: Install pnpm
42-
uses: pnpm/action-setup@v4
48+
- name: 🥡 Setup pnpm
49+
id: setup-pnpm
50+
uses: pnpm/[email protected]
4351
with:
44-
version: 9
52+
version: latest
53+
run_install: false
4554

46-
- name: Install dependencies
55+
- name: 🧩 Install Dependencies
56+
id: install-dependencies
4757
run: pnpm install
4858

49-
- name: Run audit
50-
run: |
51-
pnpm audit --json > audit-results.json || true
52-
pnpm audit --audit-level=high
53-
54-
- name: Upload audit results
55-
uses: actions/upload-artifact@v4
56-
with:
57-
name: pnpm-audit-report
58-
path: audit-results.json
59+
- name: 🧩 Run Security Audit
60+
id: run-security-audit
61+
run: pnpm audit --audit-level=high

0 commit comments

Comments
 (0)