mirror of https://github.com/actions/toolkit
allow localhost hostnames for artifact checks
parent
361a115e53
commit
176b40a888
|
@ -1,5 +1,9 @@
|
||||||
# @actions/artifact Releases
|
# @actions/artifact Releases
|
||||||
|
|
||||||
|
### 2.1.8
|
||||||
|
|
||||||
|
- Allows `*.localhost` domains for hostname checks for local development.
|
||||||
|
|
||||||
### 2.1.7
|
### 2.1.7
|
||||||
|
|
||||||
- Update unzip-stream dependency and reverted to using `unzip.Extract()`
|
- Update unzip-stream dependency and reverted to using `unzip.Extract()`
|
||||||
|
|
|
@ -20,6 +20,11 @@ describe('isGhes', () => {
|
||||||
expect(config.isGhes()).toBe(false)
|
expect(config.isGhes()).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should return false when the request domain ends with .localhost', () => {
|
||||||
|
process.env.GITHUB_SERVER_URL = 'https://github.localhost'
|
||||||
|
expect(config.isGhes()).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
it('should return false when the request domain is specific to an enterprise', () => {
|
it('should return false when the request domain is specific to an enterprise', () => {
|
||||||
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
|
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
|
||||||
expect(config.isGhes()).toBe(true)
|
expect(config.isGhes()).toBe(true)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.1.7",
|
"version": "2.1.8",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions artifact lib",
|
"description": "Actions artifact lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
@ -30,10 +30,10 @@ export function isGhes(): boolean {
|
||||||
|
|
||||||
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
||||||
const isGitHubHost = hostname === 'GITHUB.COM'
|
const isGitHubHost = hostname === 'GITHUB.COM'
|
||||||
const isGheHost =
|
const isGheHost = hostname.endsWith('.GHE.COM')
|
||||||
hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')
|
const isLocalHost = hostname.endsWith('.LOCALHOST')
|
||||||
|
|
||||||
return !isGitHubHost && !isGheHost
|
return !isGitHubHost && !isGheHost && !isLocalHost
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getGitHubWorkspaceDir(): string {
|
export function getGitHubWorkspaceDir(): string {
|
||||||
|
|
Loading…
Reference in New Issue