Compare commits

..

11 Commits

Author SHA1 Message Date
John Wesley Walker III
55f79d95df Use concise WhitespaceMode names 2024-10-17 23:01:47 +00:00
John Wesley Walker III
7fd13ec418 Address hasContent readability 2024-10-17 22:54:12 +00:00
John Wesley Walker III
7695871fe0 ran npm run build 2024-10-17 17:50:52 +00:00
John Wesley Walker III
914445f9e7 Responded to PR feedback. 2024-10-17 17:46:35 +00:00
John Wesley Walker III
041723abcc updated unit tests 2024-10-17 11:56:31 +00:00
John Wesley Walker III
813c3f2d82 Apply suggestions from @easyt
Co-authored-by: Erez Testiler <easyt@github.com>
2024-10-17 13:49:31 +02:00
John Wesley Walker III
19060a122d ran npm run build 2024-10-16 18:18:09 +00:00
John Wesley Walker III
7fcbcdce7d ran npm run format 2024-10-16 18:15:26 +00:00
John Wesley Walker III
2f42443dda restore passing baseUrl where appropriate 2024-10-16 17:35:40 +00:00
John Wesley Walker III
df4b58c789 second attempt 2024-10-16 17:29:39 +00:00
John Wesley Walker III
e8e821983d utl-helper.ts now leverages well-known environment variables. 2024-10-11 15:31:54 +00:00
4 changed files with 3 additions and 44 deletions

View File

@@ -1,9 +1,5 @@
# Changelog
## v4.2.2
* `url-helper.ts` now leverages well-known environment variables by @jww3 in https://github.com/actions/checkout/pull/1941
* Expand unit test coverage for `isGhes` by @jww3 in https://github.com/actions/checkout/pull/1946
## v4.2.1
* Check out other refs/* by commit if provided, fall back to ref by @orhantoy in https://github.com/actions/checkout/pull/1924

View File

@@ -24,50 +24,13 @@ describe('getServerUrl tests', () => {
})
describe('isGhes tests', () => {
const pristineEnv = process.env
beforeEach(() => {
jest.resetModules()
process.env = {...pristineEnv}
})
afterAll(() => {
process.env = pristineEnv
})
it('basics', async () => {
delete process.env['GITHUB_SERVER_URL']
expect(urlHelper.isGhes()).toBeFalsy()
expect(urlHelper.isGhes('https://github.com')).toBeFalsy()
expect(urlHelper.isGhes('https://contoso.ghe.com')).toBeFalsy()
expect(urlHelper.isGhes('https://test.github.localhost')).toBeFalsy()
expect(urlHelper.isGhes('https://src.onpremise.fabrikam.com')).toBeTruthy()
})
it('returns false when the GITHUB_SERVER_URL environment variable is not defined', async () => {
delete process.env['GITHUB_SERVER_URL']
expect(urlHelper.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(urlHelper.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(urlHelper.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(urlHelper.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(urlHelper.isGhes()).toBeTruthy()
})
})
describe('getServerApiUrl tests', () => {

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "checkout",
"version": "4.2.2",
"version": "4.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "checkout",
"version": "4.2.2",
"version": "4.2.1",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.1",

View File

@@ -1,6 +1,6 @@
{
"name": "checkout",
"version": "4.2.2",
"version": "4.2.1",
"description": "checkout action",
"main": "lib/main.js",
"scripts": {