mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +00:00
Add support for adding a token on GHES to prevent rate limiting
This commit is contained in:
parent
9a115684c9
commit
0b992d8a43
3 changed files with 15 additions and 2 deletions
|
@ -16,6 +16,9 @@ inputs:
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
cache-dependency-path:
|
cache-dependency-path:
|
||||||
description: 'Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies.'
|
description: 'Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies.'
|
||||||
|
ghes_token:
|
||||||
|
description: Used to pull python distributions from actions/python-versions when using Github Enterprise. This should be a github.com read only access token
|
||||||
|
default: ""
|
||||||
outputs:
|
outputs:
|
||||||
python-version:
|
python-version:
|
||||||
description: "The installed python version. Useful when given a version range as input."
|
description: "The installed python version. Useful when given a version range as input."
|
||||||
|
|
7
dist/setup/index.js
vendored
7
dist/setup/index.js
vendored
|
@ -52264,7 +52264,12 @@ const tc = __importStar(__webpack_require__(533));
|
||||||
const exec = __importStar(__webpack_require__(986));
|
const exec = __importStar(__webpack_require__(986));
|
||||||
const utils_1 = __webpack_require__(163);
|
const utils_1 = __webpack_require__(163);
|
||||||
const TOKEN = core.getInput('token');
|
const TOKEN = core.getInput('token');
|
||||||
const AUTH = !TOKEN || utils_1.isGhes() ? undefined : `token ${TOKEN}`;
|
const GHES_TOKEN = core.getInput('ghes_token');
|
||||||
|
const AUTH = utils_1.isGhes()
|
||||||
|
? `token ${GHES_TOKEN}`
|
||||||
|
: TOKEN
|
||||||
|
? `token ${TOKEN}`
|
||||||
|
: undefined;
|
||||||
const MANIFEST_REPO_OWNER = 'actions';
|
const MANIFEST_REPO_OWNER = 'actions';
|
||||||
const MANIFEST_REPO_NAME = 'python-versions';
|
const MANIFEST_REPO_NAME = 'python-versions';
|
||||||
const MANIFEST_REPO_BRANCH = 'main';
|
const MANIFEST_REPO_BRANCH = 'main';
|
||||||
|
|
|
@ -6,7 +6,12 @@ import {ExecOptions} from '@actions/exec/lib/interfaces';
|
||||||
import {IS_WINDOWS, IS_LINUX, isGhes} from './utils';
|
import {IS_WINDOWS, IS_LINUX, isGhes} from './utils';
|
||||||
|
|
||||||
const TOKEN = core.getInput('token');
|
const TOKEN = core.getInput('token');
|
||||||
const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`;
|
const GHES_TOKEN = core.getInput('ghes_token');
|
||||||
|
const AUTH = isGhes()
|
||||||
|
? `token ${GHES_TOKEN}`
|
||||||
|
: TOKEN
|
||||||
|
? `token ${TOKEN}`
|
||||||
|
: undefined;
|
||||||
const MANIFEST_REPO_OWNER = 'actions';
|
const MANIFEST_REPO_OWNER = 'actions';
|
||||||
const MANIFEST_REPO_NAME = 'python-versions';
|
const MANIFEST_REPO_NAME = 'python-versions';
|
||||||
const MANIFEST_REPO_BRANCH = 'main';
|
const MANIFEST_REPO_BRANCH = 'main';
|
||||||
|
|
Loading…
Add table
Reference in a new issue