You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: refactor GitHub Action to use published npm package via npx (#687)
- Remove npm ci and build steps; use npx cve-lite-cli@version instead
- Add version input (default: 1) to pin to latest 1.x release
- Add major version check that warns when a newer major is available
Closes#686
Copy file name to clipboardExpand all lines: action.yml
+19-12Lines changed: 19 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,10 @@ inputs:
67
67
description: "Path to a PEM CA certificate file for corporate SSL inspection proxies"
68
68
required: false
69
69
default: ""
70
+
version:
71
+
description: "CVE Lite CLI version to install (e.g. '1.23.1', '1', 'latest')"
72
+
required: false
73
+
default: "1"
70
74
71
75
runs:
72
76
using: "composite"
@@ -76,15 +80,18 @@ runs:
76
80
with:
77
81
node-version: ${{ inputs.node-version }}
78
82
79
-
- name: Install CVE Lite CLI dependencies
80
-
shell: bash
81
-
working-directory: ${{ github.action_path }}
82
-
run: npm ci
83
-
84
-
- name: Build CVE Lite CLI
83
+
- name: Check for new major version
85
84
shell: bash
86
-
working-directory: ${{ github.action_path }}
87
-
run: npm run build
85
+
env:
86
+
INPUT_VERSION: ${{ inputs.version }}
87
+
run: |
88
+
LATEST=$(npm view cve-lite-cli version 2>/dev/null || echo "")
89
+
if [[ -z "$LATEST" || "$INPUT_VERSION" == "latest" ]]; then exit 0; fi
90
+
CURRENT_MAJOR="${INPUT_VERSION%%.*}"
91
+
LATEST_MAJOR="${LATEST%%.*}"
92
+
if [[ "$LATEST_MAJOR" -gt "$CURRENT_MAJOR" ]]; then
93
+
echo "::warning::CVE Lite CLI v${LATEST_MAJOR} is available. You are currently using v${CURRENT_MAJOR}.x. Update the 'version' input in your workflow to upgrade."
0 commit comments