Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf86e08

Browse filesBrowse files
authored
Revert "Pass the token input through on GHES (actions#427)" (actions#437)
This reverts commit 7e4abae.
1 parent 8fb4cbf commit cf86e08
Copy full SHA for cf86e08

File tree

Expand file treeCollapse file tree

5 files changed

+7
-14
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+7
-14
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,7 @@ If you are experiencing problems while configuring Python on your self-hosted ru
366366

367367
`setup-python` comes pre-installed on the appliance with GHES if Actions is enabled. When dynamically downloading Python distributions, `setup-python` downloads distributions from [`actions/python-versions`](https://github.com/actions/python-versions) on github.com (outside of the appliance). These calls to `actions/python-versions` are made via unauthenticated requests, which are limited to [60 requests per hour per IP](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting). If more requests are made within the time frame, then you will start to see rate-limit errors during download that read `##[error]API rate limit exceeded for...`.
368368

369-
To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` input for the action:
370-
371-
```yml
372-
uses: actions/setup-python@v4
373-
with:
374-
token: ${{ secrets.GH_DOTCOM_TOKEN }}
375-
python-version: 3.11
376-
```
369+
To avoid hitting rate-limit problems, we recommend [setting up your own runner tool cache](https://docs.github.com/en/enterprise-server@2.22/admin/github-actions/managing-access-to-actions-from-githubcom/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access#about-the-included-setup-actions-and-the-runner-tool-cache).
377370

378371
# License
379372

‎action.yml

Copy file name to clipboardExpand all lines: action.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
architecture:
1414
description: 'The target architecture (x86, x64) of the Python interpreter.'
1515
token:
16-
description: The token used to authenticate when to fetching Python distributions from https://github.com/actions/python-versions. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
16+
description: Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user.
1717
default: ${{ github.token }}
1818
cache-dependency-path:
1919
description: 'Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies.'

‎dist/setup/index.js

Copy file name to clipboardExpand all lines: dist/setup/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64432,7 +64432,7 @@ const tc = __importStar(__nccwpck_require__(7784));
6443264432
const exec = __importStar(__nccwpck_require__(1514));
6443364433
const utils_1 = __nccwpck_require__(1314);
6443464434
const TOKEN = core.getInput('token');
64435-
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
64435+
const AUTH = !TOKEN || utils_1.isGhes() ? undefined : `token ${TOKEN}`;
6443664436
const MANIFEST_REPO_OWNER = 'actions';
6443764437
const MANIFEST_REPO_NAME = 'python-versions';
6443864438
const MANIFEST_REPO_BRANCH = 'main';

‎package-lock.json

Copy file name to clipboardExpand all lines: package-lock.json
+2-2Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/install-python.ts

Copy file name to clipboardExpand all lines: src/install-python.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import * as core from '@actions/core';
33
import * as tc from '@actions/tool-cache';
44
import * as exec from '@actions/exec';
55
import {ExecOptions} from '@actions/exec/lib/interfaces';
6-
import {IS_WINDOWS, IS_LINUX} from './utils';
6+
import {IS_WINDOWS, IS_LINUX, isGhes} from './utils';
77

88
const TOKEN = core.getInput('token');
9-
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
9+
const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`;
1010
const MANIFEST_REPO_OWNER = 'actions';
1111
const MANIFEST_REPO_NAME = 'python-versions';
1212
const MANIFEST_REPO_BRANCH = 'main';

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.