From 6c1fcca9220f51b54517da86ec7f1b6821e2266b Mon Sep 17 00:00:00 2001 From: Rebel028 Date: Tue, 20 Oct 2020 14:46:23 +0300 Subject: [PATCH] added hack to get versions array from GPR --- index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index db47a6d..c3ca4ff 100644 --- a/index.js +++ b/index.js @@ -93,8 +93,16 @@ class Action { } console.log(`Package Name: ${this.packageName}`) + let requestUrl = "" - https.get(`${this.nugetSource}/v3-flatcontainer/${this.packageName}/index.json`, res => { + //small hack to get package versions from Github Package Registry + if (this.nugetSource.startsWith(`https://nuget.pkg.github.com/`)) { + requestUrl = `${this.nugetSource}/download/${this.packageName}/index.json` + } else { + requestUrl = `${this.nugetSource}/v3-flatcontainer/${this.packageName}/index.json` + } + + https.get(requestUrl, res => { let body = "" if (res.statusCode == 404)