-
Notifications
You must be signed in to change notification settings - Fork 551
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
Add support for locally hosted GHES instances to reduce rate limiting #720
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,11 @@ const AUTH = !TOKEN ? undefined : `token ${TOKEN}`; | |
const MANIFEST_REPO_OWNER = 'actions'; | ||
const MANIFEST_REPO_NAME = 'python-versions'; | ||
const MANIFEST_REPO_BRANCH = 'main'; | ||
export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; | ||
const API_URL = core.getInput('github_api_url'); | ||
const GITHUB_API_URL = API_URL ? 'https://api.github.com' : API_URL; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. truthy and falsey expressions are backwards here, should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. truthy and falsey expressions are backwards here, should be |
||
export const MANIFEST_URL = `${GITHUB_RAW_URL}/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; | ||
|
||
export async function findReleaseFromManifest( | ||
semanticVersionSpec: string, | ||
|
@@ -33,13 +37,14 @@ export async function findReleaseFromManifest( | |
|
||
export function getManifest(): Promise<tc.IToolRelease[]> { | ||
core.debug( | ||
`Getting manifest from ${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}` | ||
`Getting manifest from ${GITHUB_API_URL}/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}@${MANIFEST_REPO_BRANCH}` | ||
); | ||
return tc.getManifestFromRepo( | ||
MANIFEST_REPO_OWNER, | ||
MANIFEST_REPO_NAME, | ||
AUTH, | ||
MANIFEST_REPO_BRANCH | ||
MANIFEST_REPO_BRANCH, | ||
GITHUB_API_URL | ||
); | ||
} | ||
|
||
|
There was a problem hiding this comment.
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 ofsrc/install-python.ts
. The code here indist/*
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.