Compare commits

...

6 Commits

Author SHA1 Message Date
aparnajyothi-y 1a672ffcb0
Merge fff08b1717 into 9c76e71650 2024-10-22 13:55:09 +05:45
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
Jeff Widman 19dfb7b659
Bump default versions to latest (#905)
People copy/paste these values all the time... might as well start them off on the right foot with a modern default.
2024-10-04 11:28:10 -05:00
Joel Ambass e9675cc634
Merge pull request #943 from actions/Jcambass-patch-1
Upgrade IA publish
2024-09-26 08:24:10 +02:00
Joel Ambass 3226af69c0
Upgrade IA publish 2024-09-16 17:18:49 +02:00
6 changed files with 58 additions and 11 deletions

View File

@ -2,7 +2,7 @@ name: 'Publish Immutable Action Version'
on:
release:
types: [created]
types: [published]
jobs:
publish:
@ -17,6 +17,4 @@ jobs:
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
uses: actions/publish-immutable-action@0.0.3

View File

@ -21,7 +21,7 @@ steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- run: python my_script.py
```
@ -31,7 +31,7 @@ steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 'pypy3.9'
python-version: 'pypy3.10'
- run: python my_script.py
```
@ -41,7 +41,7 @@ steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 'graalpy-22.3'
python-version: 'graalpy-24.0'
- run: python my_script.py
```
@ -76,7 +76,7 @@ steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.12'
cache: 'pip' # caching pip dependencies
- run: pip install -r requirements.txt
```

View File

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

View File

@ -13,6 +13,7 @@ import {
getVersionInputFromPlainFile,
getVersionInputFromTomlFile,
getNextPageUrl,
isGhes,
IS_WINDOWS,
getDownloadFileName
} 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();
});
});

6
dist/setup/index.js vendored
View File

@ -92017,7 +92017,11 @@ function validatePythonVersionFormatForPyPy(version) {
exports.validatePythonVersionFormatForPyPy = validatePythonVersionFormatForPyPy;
function isGhes() {
const ghUrl = new URL(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;
}
exports.isGhes = isGhes;
function isCacheFeatureAvailable() {

View File

@ -116,7 +116,13 @@ export function isGhes(): boolean {
const ghUrl = new URL(
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 {