@renovatebot/osv-offline 1.1.5 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/download.js +12 -3
- package/package.json +3 -3
package/dist/lib/download.js
CHANGED
|
@@ -32,9 +32,18 @@ async function tryDownloadDb() {
|
|
|
32
32
|
luxon_1.DateTime.utc().diff(luxon_1.DateTime.fromJSDate(stats.mtime)).as('days') < 1) {
|
|
33
33
|
return true;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const octokitOptions = process.env.GITHUB_COM_TOKEN
|
|
36
|
+
? { auth: process.env.GITHUB_COM_TOKEN }
|
|
37
|
+
: undefined;
|
|
38
|
+
let latestRelease = null;
|
|
39
|
+
try {
|
|
40
|
+
latestRelease = (await new rest_1.Octokit(octokitOptions).repos.listReleases({
|
|
41
|
+
...baseParameters,
|
|
42
|
+
})).data[0];
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
38
47
|
const asset = latestRelease?.assets.find((asset) => asset.name === 'osv-offline.zip');
|
|
39
48
|
// if local database is the same size as remote database, don't download again
|
|
40
49
|
if (asset?.size === stats?.size) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@renovatebot/osv-offline",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"@types/adm-zip": "0.5.0",
|
|
20
20
|
"@types/fs-extra": "11.0.1",
|
|
21
21
|
"@types/luxon": "3.2.0",
|
|
22
|
-
"@types/node": "18.
|
|
22
|
+
"@types/node": "18.13.0",
|
|
23
23
|
"prettier": "2.8.3",
|
|
24
24
|
"ts-node": "10.9.1",
|
|
25
|
-
"typescript": "4.9.
|
|
25
|
+
"typescript": "4.9.5"
|
|
26
26
|
}
|
|
27
27
|
}
|