Skip to content

Add support for locally hosted GHES instances to reduce rate limiting #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
npm run build
  • Loading branch information
Gable authored and Gable committed Aug 24, 2023
commit 17f8fc08c2aaa40227af0cc827455a71ec662400
9 changes: 4 additions & 5 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10957,10 +10957,10 @@ function findAllVersions(toolName, arch) {
return versions;
}
exports.findAllVersions = findAllVersions;
function getManifestFromRepo(owner, repo, auth, branch = 'master', serverUrl = "https://api.github.com") {
function getManifestFromRepo(owner, repo, auth, branch = 'master', serverUrl = 'https://api.github.com') {
Copy link

@jhaxon jhaxon Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getManifestFromRepo() is a function from a library imported at the top of src/install-python.ts. The code here in dist/* is generated from that library at compile time, so your changes will be overwritten.

For reference, here is the source of the library function. If you truly intend to reuse the library function you'll first need to merge a PR changing its signature here.

In order for this PR to work you need to limit your changes to the src/*.ts files.

return __awaiter(this, void 0, void 0, function* () {
let releases = [];
const treeUrl = `${serverUrl}/repos/${owner}/${repo}/git/trees/${branch}`;
const treeUrl = `${serverUrl}/${owner}/${repo}/git/trees/${branch}`;
const http = new httpm.HttpClient('tool-cache');
const headers = {};
if (auth) {
Expand Down Expand Up @@ -69686,11 +69686,10 @@ const MANIFEST_REPO_OWNER = 'actions';
const MANIFEST_REPO_NAME = 'python-versions';
const MANIFEST_REPO_BRANCH = 'main';
const API_URL = core.getInput('github_api_url');
const GITHUB_API_URL = API_URL ? "https://api.github.com" : API_URL;
const GITHUB_API_URL = API_URL ? 'https://api.github.com' : API_URL;
const RAW_URL = core.getInput('github_raw_url');
const GITHUB_RAW_URL = RAW_URL ? "https://raw.githubusercontent.com" : RAW_URL;
const GITHUB_RAW_URL = RAW_URL ? 'https://raw.githubusercontent.com' : RAW_URL;
exports.MANIFEST_URL = `${GITHUB_RAW_URL}/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;

function findReleaseFromManifest(semanticVersionSpec, architecture, manifest) {
return __awaiter(this, void 0, void 0, function* () {
if (!manifest) {
Expand Down
4 changes: 2 additions & 2 deletions src/install-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const MANIFEST_REPO_OWNER = 'actions';
const MANIFEST_REPO_NAME = 'python-versions';
const MANIFEST_REPO_BRANCH = 'main';
const API_URL = core.getInput('github_api_url');
const GITHUB_API_URL = API_URL ? "https://api.github.com" : API_URL;
const GITHUB_API_URL = API_URL ? 'https://api.github.com' : API_URL;
Copy link

@jhaxon jhaxon Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

truthy and falsey expressions are backwards here, should be API_URL ? API_URL : ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit tests caught this! ;)

const RAW_URL = core.getInput('github_raw_url');
const GITHUB_RAW_URL = RAW_URL ? "https://raw.githubusercontent.com" : RAW_URL;
const GITHUB_RAW_URL = RAW_URL ? 'https://raw.githubusercontent.com' : RAW_URL;
Copy link

@jhaxon jhaxon Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

truthy and falsey expressions are backwards here, should be RAW_URL ? RAW_URL : ...

export const MANIFEST_URL = `${GITHUB_RAW_URL}/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;

export async function findReleaseFromManifest(
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy