Skip to content

Commit efe235b

Browse files
committed
fix: downgrade version to 1.1.0 in package.json and check.js
1 parent 940a08b commit efe235b

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

check.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const fs = require("fs");
33
const path = require("path");
44
const https = require("https");
55

6-
const SCANNER_VERSION = '1.2.0'; // x-release-please-version
6+
const SCANNER_VERSION = '1.1.0'; // x-release-please-version
77
const DEFAULT_GITHUB_CSV_URL = 'https://github.com/OpenForgeProject/supply-chain-scanner/tree/main/csv';
88

99
function parseCsvLine(line) {
@@ -118,18 +118,19 @@ function compareVersions(a, b) {
118118

119119
async function checkForUpdate(localVersion) {
120120
try {
121-
const token = process.env.GITHUB_TOKEN || '';
122121
const response = await httpsGet(
123-
'https://api.github.com/repos/OpenForgeProject/supply-chain-scanner/releases/latest',
124-
token
122+
'https://raw.githubusercontent.com/OpenForgeProject/supply-chain-scanner/main/package.json'
125123
);
126-
const release = JSON.parse(response);
127-
const latestVersion = (release.tag_name || '').replace(/^v/, '');
124+
const pkg = JSON.parse(response);
125+
const latestVersion = (pkg.version || '').replace(/^v/, '');
128126
if (!latestVersion) return;
129127

130128
if (compareVersions(latestVersion, localVersion) > 0) {
131129
log(`💡 Update available: v${localVersion} → v${latestVersion}`, 'yellow');
132-
log(' Run: npm install -g supply-chain-scanner', 'yellow');
130+
log(' Please download the latest version from GitHub: https://github.com/OpenForgeProject/supply-chain-scanner', 'yellow');
131+
log('', 'reset');
132+
} else {
133+
log(`✅ You are using the latest version (v${localVersion})`, 'green');
133134
log('', 'reset');
134135
}
135136
} catch {
@@ -446,11 +447,11 @@ async function checkAffectedVersions() {
446447
log('', 'reset');
447448
log(`Supply Chain Scanner v${localVersion} - Powered by OpenForgeProject`, 'cyan');
448449
log('', 'reset');
450+
await checkForUpdate(localVersion);
451+
log('', 'reset');
449452
log(`${colors.bold}Checking for compromised packages...${colors.reset}`, 'cyan');
450453
log('', 'reset');
451454

452-
await checkForUpdate(localVersion);
453-
454455
if (!fs.existsSync(cli.scanPath)) {
455456
log(`Scan path not found: ${cli.scanPath}`, 'red');
456457
process.exitCode = 1;
@@ -473,7 +474,7 @@ async function checkAffectedVersions() {
473474
process.exitCode = 1;
474475
return;
475476
}
476-
477+
log('', 'reset');
477478
if (affectedEntries.length === 0) {
478479
if (source === 'github') {
479480
log('No valid npm entries were loaded from the GitHub CSV source.', 'yellow');
@@ -486,10 +487,9 @@ async function checkAffectedVersions() {
486487
}
487488

488489
log(`Loaded affected package versions from CSV: ${affectedEntries.length}`, 'blue');
489-
490490
log(`Scan path: ${cli.scanPath}`, 'blue');
491491
log(`Recursive scan: ${cli.recursive ? 'enabled' : 'disabled'}`, 'blue');
492-
492+
log('', 'reset');
493493
const nodeModulesPaths = await runWithSpinner(
494494
'Scan node_modules directories ...',
495495
() => findNodeModules(cli.scanPath, cli.recursive)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supply-chain-scanner",
3-
"version": "1.2.0",
3+
"version": "1.1.0",
44
"description": "CLI scanner for compromised npm packages based on CSV advisories.",
55
"bin": {
66
"supply-chain-scanner": "./check.js"

0 commit comments

Comments
 (0)