Compare commits

...

5 Commits

Author SHA1 Message Date
Remi Cattiau f12febe2cb
Merge 05b0430d2d into 9c76e71650 2024-10-22 08:17:57 +02:00
aparnajyothi-y 9c76e71650
Bump pillow from 7.2 to 10.2.0 in /__tests__/data (#956)
* Update e2e-cache.yml

* Update basic-validation.yml

* Pyinstaller upgrade to 5.13.1

* pyinstaller-update

* Update basic-validation.yml

* Update e2e-cache.yml

* fix-db-alert-164-165-166

* upgrade pillow
2024-10-21 15:39:11 -05:00
John Wesley Walker III f4c5a1183d
Revise `isGhes` logic (#963)
* Revise `isGhes` logic

* ran `npm run format`

* add unit test

* ran `npm run format`
2024-10-21 11:42:17 -05:00
Remi Cattiau 05b0430d2d
fix: allow to pick which version to use by only removing platform_version for this version 2024-08-29 21:56:07 -07:00
Remi Cattiau 427878c2d3
feat: add ignore-platform-version option to allow install on debian 2024-08-29 08:57:00 -07:00
7 changed files with 57569 additions and 78648 deletions

View File

@ -30,7 +30,7 @@ pdf2image==1.12.1
pefile==2021.9.3; python_full_version >= '3.6.0' pefile==2021.9.3; python_full_version >= '3.6.0'
pillow==7.2 pillow>=10.2.0
pygments==2.6.1 pygments==2.6.1

View File

@ -13,6 +13,7 @@ import {
getVersionInputFromPlainFile, getVersionInputFromPlainFile,
getVersionInputFromTomlFile, getVersionInputFromTomlFile,
getNextPageUrl, getNextPageUrl,
isGhes,
IS_WINDOWS, IS_WINDOWS,
getDownloadFileName getDownloadFileName
} from '../src/utils'; } from '../src/utils';
@ -195,3 +196,41 @@ describe('getDownloadFileName', () => {
} }
}); });
}); });
describe('isGhes', () => {
const pristineEnv = process.env;
beforeEach(() => {
jest.resetModules();
process.env = {...pristineEnv};
});
afterAll(() => {
process.env = pristineEnv;
});
it('returns false when the GITHUB_SERVER_URL environment variable is not defined', async () => {
delete process.env['GITHUB_SERVER_URL'];
expect(isGhes()).toBeFalsy();
});
it('returns false when the GITHUB_SERVER_URL environment variable is set to github.com', async () => {
process.env['GITHUB_SERVER_URL'] = 'https://github.com';
expect(isGhes()).toBeFalsy();
});
it('returns false when the GITHUB_SERVER_URL environment variable is set to a GitHub Enterprise Cloud-style URL', async () => {
process.env['GITHUB_SERVER_URL'] = 'https://contoso.ghe.com';
expect(isGhes()).toBeFalsy();
});
it('returns false when the GITHUB_SERVER_URL environment variable has a .localhost suffix', async () => {
process.env['GITHUB_SERVER_URL'] = 'https://mock-github.localhost';
expect(isGhes()).toBeFalsy();
});
it('returns true when the GITHUB_SERVER_URL environment variable is set to some other URL', async () => {
process.env['GITHUB_SERVER_URL'] = 'https://src.onpremise.fabrikam.com';
expect(isGhes()).toBeTruthy();
});
});

View File

@ -26,6 +26,10 @@ inputs:
allow-prereleases: 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." 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 default: false
ignore-platform-version:
description: "Ignore the specific platform version to allow usage on Debian"
default: ""
required: false
outputs: outputs:
python-version: python-version:
description: "The installed Python or PyPy version. Useful when given a version range as input." description: "The installed Python or PyPy version. Useful when given a version range as input."

67053
dist/cache-save/index.js vendored

File diff suppressed because one or more lines are too long

68131
dist/setup/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,23 @@ export async function findReleaseFromManifest(
export async function getManifest(): Promise<tc.IToolRelease[]> { export async function getManifest(): Promise<tc.IToolRelease[]> {
try { try {
return await getManifestFromRepo(); const manifest = await getManifestFromRepo();
if (core.getInput('ignore-platform-version')) {
// Display each tool
manifest.forEach(tool => {
tool.files.forEach(f => {
if (
f.platform_version === core.getInput('ignore-platform-version') ||
'all' === core.getInput('ignore-platform-version')
) {
f.platform_version = undefined;
}
});
});
}
return manifest;
} catch (err) { } catch (err) {
core.debug('Fetching the manifest via the API failed.'); core.debug('Fetching the manifest via the API failed.');
if (err instanceof Error) { if (err instanceof Error) {

View File

@ -116,7 +116,13 @@ export function isGhes(): boolean {
const ghUrl = new URL( const ghUrl = new URL(
process.env['GITHUB_SERVER_URL'] || 'https://github.com' process.env['GITHUB_SERVER_URL'] || 'https://github.com'
); );
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
const isGitHubHost = hostname === 'GITHUB.COM';
const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
const isLocalHost = hostname.endsWith('.LOCALHOST');
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
} }
export function isCacheFeatureAvailable(): boolean { export function isCacheFeatureAvailable(): boolean {