@@ -91388,11 +91388,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
91388
91388
});
91389
91389
};
91390
91390
Object.defineProperty(exports, "__esModule", ({ value: true }));
91391
- exports.installCpythonFromRelease = exports.getManifest = exports.findReleaseFromManifest = exports.MANIFEST_URL = void 0;
91391
+ exports.installCpythonFromRelease = exports.getManifestFromURL = exports.getManifestFromRepo = exports. getManifest = exports.findReleaseFromManifest = exports.MANIFEST_URL = void 0;
91392
91392
const path = __importStar(__nccwpck_require__(1017));
91393
91393
const core = __importStar(__nccwpck_require__(2186));
91394
91394
const tc = __importStar(__nccwpck_require__(7784));
91395
91395
const exec = __importStar(__nccwpck_require__(1514));
91396
+ const httpm = __importStar(__nccwpck_require__(6255));
91396
91397
const utils_1 = __nccwpck_require__(1314);
91397
91398
const TOKEN = core.getInput('token');
91398
91399
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
@@ -91411,10 +91412,37 @@ function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) {
91411
91412
}
91412
91413
exports.findReleaseFromManifest = findReleaseFromManifest;
91413
91414
function getManifest() {
91415
+ return __awaiter(this, void 0, void 0, function* () {
91416
+ try {
91417
+ return yield getManifestFromRepo();
91418
+ }
91419
+ catch (err) {
91420
+ core.debug('Fetching the manifest via the API failed.');
91421
+ if (err instanceof Error) {
91422
+ core.debug(err.message);
91423
+ }
91424
+ }
91425
+ return yield getManifestFromURL();
91426
+ });
91427
+ }
91428
+ exports.getManifest = getManifest;
91429
+ function getManifestFromRepo() {
91414
91430
core.debug(`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}`);
91415
91431
return tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH);
91416
91432
}
91417
- exports.getManifest = getManifest;
91433
+ exports.getManifestFromRepo = getManifestFromRepo;
91434
+ function getManifestFromURL() {
91435
+ return __awaiter(this, void 0, void 0, function* () {
91436
+ core.debug('Falling back to fetching the manifest using raw URL.');
91437
+ const http = new httpm.HttpClient('tool-cache');
91438
+ const response = yield http.getJson(exports.MANIFEST_URL);
91439
+ if (!response.result) {
91440
+ throw new Error(`Unable to get manifest from ${exports.MANIFEST_URL}`);
91441
+ }
91442
+ return response.result;
91443
+ });
91444
+ }
91445
+ exports.getManifestFromURL = getManifestFromURL;
91418
91446
function installPython(workingDirectory) {
91419
91447
return __awaiter(this, void 0, void 0, function* () {
91420
91448
const options = {
0 commit comments