1 Commits

Author SHA1 Message Date
aef5ea64d0 切换源 2023-10-23 02:31:04 +08:00

10
dist/setup/index.js vendored
View File

@@ -61594,12 +61594,14 @@ function getManifestFromRepo(owner, repo, auth, branch = 'master') {
}
}
headers['accept'] = 'application/vnd.github.VERSION.raw';
let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
if (versionsRaw) {
const versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
const base64 = JSON.parse(versionsRaw);
let tmp = Buffer.from(base64['content'], 'base64').toString('ascii');
if (tmp) {
// shouldn't be needed but protects against invalid json saved with BOM
versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
tmp = tmp.replace(/^\uFEFF/, '');
try {
releases = JSON.parse(versionsRaw);
releases = JSON.parse(tmp);
}
catch (_a) {
core.debug('Invalid json');