From dde4cb22a986a529c8bcea8cd1ff68e2f91ba574 Mon Sep 17 00:00:00 2001 From: YOUNG HO CHA Date: Mon, 14 Aug 2023 00:39:14 +0900 Subject: [PATCH] Get manifest location information from inputs --- action.yml | 6 ++++++ src/install-python.ts | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 3a6531c8..ff7b5307 100644 --- a/action.yml +++ b/action.yml @@ -26,6 +26,12 @@ inputs: allow-prereleases: description: "When 'true', a version range passed to 'python-version' input will match prerelease versions if no GA versions are found. Only 'x.y' version range is supported for CPython." default: false + versions-manifest-repo-owner: + description: "Github owner of versions-manifest.json file" + versions-manifest-repo-name: + description: "Github repo name of versions-manifest.json file" + versions-manifest-repo-branch: + description: "Github branch name of versions-manifest.json file" outputs: python-version: description: "The installed Python or PyPy version. Useful when given a version range as input." diff --git a/src/install-python.ts b/src/install-python.ts index 2af61291..4bb1b538 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -7,9 +7,9 @@ import {IS_WINDOWS, IS_LINUX} from './utils'; const TOKEN = core.getInput('token'); const AUTH = !TOKEN ? undefined : `token ${TOKEN}`; -const MANIFEST_REPO_OWNER = 'actions'; -const MANIFEST_REPO_NAME = 'python-versions'; -const MANIFEST_REPO_BRANCH = 'main'; +const MANIFEST_REPO_OWNER = core.getInput('versions-manifest-repo-owner') || 'actions'; +const MANIFEST_REPO_NAME = core.getInput('versions-manifest-repo-name') || 'python-versions'; +const MANIFEST_REPO_BRANCH = core.getInput('versions-manifest-repo-branch') || 'main'; export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; export async function findReleaseFromManifest(