Skip to content

Commit

Permalink
added hack to get versions array from GPR
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebel028 committed Oct 20, 2020
1 parent c12b854 commit 6c1fcca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6c1fcca

Please sign in to comment.