mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-05-04 10:08:05 +08:00
lint fixes
This commit is contained in:
6
packages/cache/__tests__/cacheUtils.test.ts
vendored
6
packages/cache/__tests__/cacheUtils.test.ts
vendored
@@ -3,8 +3,8 @@ import * as path from 'path'
|
||||
import * as cacheUtils from '../src/internal/cacheUtils'
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetModules()
|
||||
});
|
||||
jest.resetModules()
|
||||
})
|
||||
|
||||
test('getArchiveFileSizeInBytes returns file size', () => {
|
||||
const filePath = path.join(__dirname, '__fixtures__', 'helloWorld.txt')
|
||||
@@ -61,4 +61,4 @@ test('isGhes returns true for enterprise URL', async () => {
|
||||
test('isGhes returns false for ghe.localhost', () => {
|
||||
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost'
|
||||
expect(cacheUtils.isGhes()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
5
packages/cache/src/internal/cacheUtils.ts
vendored
5
packages/cache/src/internal/cacheUtils.ts
vendored
@@ -137,8 +137,9 @@ export function isGhes(): boolean {
|
||||
)
|
||||
|
||||
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
||||
const isGitHubHost = (hostname == 'GITHUB.COM')
|
||||
const isGheHost = (hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST'))
|
||||
const isGitHubHost = hostname === 'GITHUB.COM'
|
||||
const isGheHost =
|
||||
hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')
|
||||
|
||||
return !isGitHubHost && !isGheHost
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user